Skip to content

Commit ca67c5d

Browse files
style: remove emoji characters from logging and status messages
1 parent 9ff3d57 commit ca67c5d

45 files changed

Lines changed: 1488 additions & 279 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ log = log.WithComponent("scanner")
369369
Use `logger.Info()` for user-facing messages (NOT fmt.Print):
370370

371371
```go
372-
// WRONG - Never use fmt.Print
372+
// WRONG - Never use fmt.Print
373373
fmt.Println(" Scan completed!")
374374
fmt.Printf("Found %d vulnerabilities\n", count)
375375

@@ -415,7 +415,7 @@ log.Errorw("Database query failed",
415415
Use structured logging for progress (NOT progress bars):
416416

417417
```go
418-
// WRONG - No ANSI progress bars
418+
// WRONG - No ANSI progress bars
419419
fmt.Printf("\r[████░░░░] 50%%")
420420

421421
// CORRECT - Structured progress logging

REFACTORING_SUMMARY.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# 🎉 SHELLS COMPLETE REFACTORING - FINAL SUMMARY
1+
# SHELLS COMPLETE REFACTORING - FINAL SUMMARY
22

33
**Session Duration**: ~4 hours
44
**Total Commits**: 23
55
**Breaking Changes**: 0
6-
**Tests Status**: All Passing
7-
**Build Status**: Success
6+
**Tests Status**: All Passing
7+
**Build Status**: Success
88

99
---
1010

@@ -30,42 +30,42 @@
3030

3131
## 🏗️ REFACTORING PHASES COMPLETED
3232

33-
### Phase 1: Orchestration Logic
33+
### Phase 1: Orchestration Logic
3434
- **Extracted**: 632 lines → `cmd/orchestrator/`
3535
- **Impact**: Main workflow coordination isolated
3636
- **Files**: 1 (orchestrator.go)
3737

38-
### Phase 2: Scanner Execution (BIGGEST WIN)
38+
### Phase 2: Scanner Execution (BIGGEST WIN)
3939
- **Extracted**: 1,849 lines → `cmd/scanners/`
4040
- **Impact**: All scanner code modularized
4141
- **Files**: 6 (executor, specialized, infrastructure, passive, secrets, ml_correlation)
4242

43-
### Phase 3: Nomad Integration
43+
### Phase 3: Nomad Integration
4444
- **Extracted**: 388 lines → `cmd/nomad/`
4545
- **Impact**: Distributed scanning isolated
4646
- **Files**: 3 (integration, legacy, parsers)
4747

48-
### Phase 5: Bug Bounty Mode
48+
### Phase 5: Bug Bounty Mode
4949
- **Extracted**: 1,324 lines → `cmd/bugbounty/`
5050
- **Impact**: Bug bounty testing explicit feature
5151
- **Files**: 1 (mode.go)
5252

53-
### Phase 6: Helper Utilities
53+
### Phase 6: Helper Utilities
5454
- **Extracted**: 21 lines → `cmd/internal/utils/`
5555
- **Impact**: Eliminated duplication
5656
- **Files**: 1 (helpers.go)
5757

58-
### Phase 7: Logger Adapters
58+
### Phase 7: Logger Adapters
5959
- **Extracted**: 260 lines → `cmd/internal/adapters/`
6060
- **Impact**: Deduplicated adapters across 5 files
6161
- **Files**: 2 (loggers.go, ml_correlation.go)
6262

63-
### Phase 8: Findings Conversion
63+
### Phase 8: Findings Conversion
6464
- **Already Done**: `cmd/internal/converters/`
6565
- **Impact**: Type conversions centralized
6666
- **Files**: 2 (findings.go + tests, 54.4% coverage)
6767

68-
### Dead Code Removal
68+
### Dead Code Removal
6969
- **Removed**: 503 lines of unused functions
7070
- **Impact**: 17 stale TODOs eliminated
7171

@@ -134,51 +134,51 @@ pkg/
134134

135135
---
136136

137-
## BENEFITS ACHIEVED
137+
## BENEFITS ACHIEVED
138138

139139
### Testability
140-
- **Dependency Injection**: No global variables
141-
- **Mockable Dependencies**: log, store, cfg passed as parameters
142-
- **Unit Tests**: 4 test files with 54-96% coverage
143-
- **Integration Tests**: PostgreSQL testcontainers enabled
144-
- **Error Returns**: All commands use RunE (no os.Exit)
140+
- **Dependency Injection**: No global variables
141+
- **Mockable Dependencies**: log, store, cfg passed as parameters
142+
- **Unit Tests**: 4 test files with 54-96% coverage
143+
- **Integration Tests**: PostgreSQL testcontainers enabled
144+
- **Error Returns**: All commands use RunE (no os.Exit)
145145

146146
### Maintainability
147-
- **File Sizes**: All files 100-400 lines (was 3,327)
148-
- **Clear Boundaries**: Single responsibility per package
149-
- **No Duplication**: Centralized adapters and utilities
150-
- **Documentation**: Comprehensive inline docs
147+
- **File Sizes**: All files 100-400 lines (was 3,327)
148+
- **Clear Boundaries**: Single responsibility per package
149+
- **No Duplication**: Centralized adapters and utilities
150+
- **Documentation**: Comprehensive inline docs
151151

152152
### Code Quality
153-
- **Context Propagation**: All functions accept context.Context
154-
- **Error Handling**: Proper error wrapping with %w
155-
- **Type Safety**: Strong typing throughout
156-
- **Compilation**: Zero errors, zero warnings
153+
- **Context Propagation**: All functions accept context.Context
154+
- **Error Handling**: Proper error wrapping with %w
155+
- **Type Safety**: Strong typing throughout
156+
- **Compilation**: Zero errors, zero warnings
157157

158158
### User Experience
159-
- **Graceful Shutdown**: Ctrl+C saves progress
160-
- **Resume Capability**: `shells resume [scan-id]`
161-
- **Progress Preservation**: Never lose scan progress
162-
- **Clear Messages**: Resume instructions shown
159+
- **Graceful Shutdown**: Ctrl+C saves progress
160+
- **Resume Capability**: `shells resume [scan-id]`
161+
- **Progress Preservation**: Never lose scan progress
162+
- **Clear Messages**: Resume instructions shown
163163

164164
---
165165

166-
## 🎯 SUCCESS CRITERIA (ALL ACHIEVED)
166+
## SUCCESS CRITERIA (ALL ACHIEVED)
167167

168-
root.go < 800 lines → **344 lines (57% below target)**
169-
No function > 100 lines → **All functions focused**
170-
All packages have tests → **4 packages with 54-96% coverage**
171-
Zero os.Exit in testable code → **100% eliminated**
172-
Context passed through → **All scan functions accept ctx**
173-
Code compiles → **go build ./cmd/... ✓**
174-
Tests pass → **go test -short ./cmd/... ✓**
175-
Graceful shutdown → **Implemented with checkpointing ✓**
168+
root.go < 800 lines → **344 lines (57% below target)**
169+
No function > 100 lines → **All functions focused**
170+
All packages have tests → **4 packages with 54-96% coverage**
171+
Zero os.Exit in testable code → **100% eliminated**
172+
Context passed through → **All scan functions accept ctx**
173+
Code compiles → **go build ./cmd/... ✓**
174+
Tests pass → **go test -short ./cmd/... ✓**
175+
Graceful shutdown → **Implemented with checkpointing ✓**
176176

177177
---
178178

179179
## 🚀 PRODUCTION READY
180180

181-
**Status**: **PRODUCTION READY**
181+
**Status**: **PRODUCTION READY**
182182

183183
The Shells codebase has been transformed from a 3,327-line monolithic file into a well-organized, testable, maintainable architecture with graceful shutdown and resume capabilities.
184184

cmd/atomic.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Examples:
222222
for _, tech := range techniques {
223223
report, err := client.ValidateTestSafety(tech)
224224
if err != nil {
225-
fmt.Printf(" %s: Validation error - %v\n", tech, err)
225+
fmt.Printf(" %s: Validation error - %v\n", tech, err)
226226
failed++
227227
continue
228228
}
@@ -231,7 +231,7 @@ Examples:
231231
fmt.Printf(" %s: Safe for bug bounty testing\n", tech)
232232
passed++
233233
} else {
234-
fmt.Printf(" %s: Failed safety validation\n", tech)
234+
fmt.Printf(" %s: Failed safety validation\n", tech)
235235
for _, violation := range report.Violations {
236236
fmt.Printf(" - %s\n", violation)
237237
}
@@ -475,14 +475,14 @@ func printTechniquesJSON(techniques []string, client *atomic.AtomicClient) {
475475
func printTechniquesTable(techniques []string, client *atomic.AtomicClient, verbose bool) {
476476
mapper := atomic.NewVulnToAttackMapper()
477477

478-
fmt.Printf("🎯 Available Safe ATT&CK Techniques (%d total)\n", len(techniques))
478+
fmt.Printf(" Available Safe ATT&CK Techniques (%d total)\n", len(techniques))
479479
fmt.Printf("═══════════════════════════════════════════════\n\n")
480480

481481
for _, technique := range techniques {
482482
test, err := client.GetSafeTest(technique)
483483
status := " Available"
484484
if err != nil {
485-
status = " Not Available"
485+
status = " Not Available"
486486
}
487487

488488
fmt.Printf("🔹 %s - %s\n", technique, mapper.GetTactic(technique))
@@ -537,12 +537,12 @@ func printSafetyReportTable(report atomic.SafetyReport) {
537537
if report.IsSafe {
538538
fmt.Printf("Status: SAFE for bug bounty testing\n\n")
539539
} else {
540-
fmt.Printf("Status: NOT SAFE for bug bounty testing\n\n")
540+
fmt.Printf("Status: NOT SAFE for bug bounty testing\n\n")
541541

542542
if len(report.Violations) > 0 {
543543
fmt.Printf("Violations:\n")
544544
for _, violation := range report.Violations {
545-
fmt.Printf(" %s\n", violation)
545+
fmt.Printf(" %s\n", violation)
546546
}
547547
fmt.Println()
548548
}
@@ -560,7 +560,7 @@ func printSafetyReportTable(report atomic.SafetyReport) {
560560
for _, check := range report.Checks {
561561
status := ""
562562
if !check.Passed {
563-
status = ""
563+
status = ""
564564
}
565565
fmt.Printf(" %s %s\n", status, check.RuleName)
566566
if check.Details != "" {

cmd/auth.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Examples:
181181

182182
fmt.Printf("🧪 Running authentication tests for: %s\n", target)
183183
if protocol != "all" {
184-
fmt.Printf("📋 Protocol: %s\n", strings.ToUpper(protocol))
184+
fmt.Printf(" Protocol: %s\n", strings.ToUpper(protocol))
185185
}
186186
fmt.Println()
187187

@@ -349,7 +349,7 @@ Examples:
349349
logger := NewLogger(verbose)
350350

351351
fmt.Printf(" Running comprehensive authentication security analysis\n")
352-
fmt.Printf("🎯 Target: %s\n\n", target)
352+
fmt.Printf(" Target: %s\n\n", target)
353353

354354
// Run comprehensive analysis
355355
report, err := runComprehensiveAnalysis(target, logger)
@@ -447,16 +447,16 @@ func printDiscoveryResults(result struct {
447447
fmt.Printf(" Authentication Discovery Results\n")
448448
fmt.Printf("═══════════════════════════════════════\n\n")
449449

450-
fmt.Printf("🎯 Target: %s\n", result.Target)
450+
fmt.Printf(" Target: %s\n", result.Target)
451451
fmt.Printf("🕐 Scanned: %s\n\n", result.Timestamp.Format("2006-01-02 15:04:05"))
452452

453-
fmt.Printf("📋 Summary:\n")
453+
fmt.Printf(" Summary:\n")
454454
fmt.Printf(" • Total endpoints: %d\n", result.Summary.TotalEndpoints)
455455
fmt.Printf(" • Protocols found: %d\n", result.Summary.ProtocolsFound)
456456
fmt.Printf(" • Federation providers: %d\n", result.Summary.FederationProviders)
457457
fmt.Println()
458458

459-
fmt.Printf("🔐 Protocols Detected:\n")
459+
fmt.Printf(" Protocols Detected:\n")
460460
if result.Summary.HasSAML {
461461
fmt.Printf(" SAML\n")
462462
}
@@ -474,7 +474,7 @@ func printDiscoveryResults(result struct {
474474
}
475475

476476
if len(result.Protocols) == 0 {
477-
fmt.Printf(" No authentication protocols detected\n")
477+
fmt.Printf(" No authentication protocols detected\n")
478478
}
479479
fmt.Println()
480480

@@ -499,7 +499,7 @@ func printTestResults(report *common.AuthReport) {
499499
fmt.Printf("🧪 Authentication Test Results\n")
500500
fmt.Printf("═══════════════════════════════════════\n\n")
501501

502-
fmt.Printf("🎯 Target: %s\n", report.Target)
502+
fmt.Printf(" Target: %s\n", report.Target)
503503
fmt.Printf("⏱️ Duration: %s\n\n", report.EndTime.Sub(report.StartTime))
504504

505505
fmt.Printf(" Summary:\n")
@@ -534,7 +534,7 @@ func printChainResults(result struct {
534534
fmt.Printf("🔗 Attack Chain Analysis Results\n")
535535
fmt.Printf("═══════════════════════════════════════\n\n")
536536

537-
fmt.Printf("🎯 Target: %s\n", result.Target)
537+
fmt.Printf(" Target: %s\n", result.Target)
538538
fmt.Printf("🕐 Analyzed: %s\n\n", result.Timestamp.Format("2006-01-02 15:04:05"))
539539

540540
fmt.Printf(" Summary:\n")
@@ -557,7 +557,7 @@ func printChainResults(result struct {
557557
for j, step := range chain.Steps {
558558
statusIcon := ""
559559
if !step.Success {
560-
statusIcon = ""
560+
statusIcon = ""
561561
}
562562
fmt.Printf(" %d. %s [%s] %s\n", j+1, statusIcon, step.Protocol, step.Description)
563563
}
@@ -674,20 +674,20 @@ func printComprehensiveDiscoveryResults(result struct {
674674
fmt.Printf(" Comprehensive Authentication Discovery Results\n")
675675
fmt.Printf("═══════════════════════════════════════════════════\n\n")
676676

677-
fmt.Printf("🎯 Target: %s\n", result.Target)
677+
fmt.Printf(" Target: %s\n", result.Target)
678678
fmt.Printf("🕐 Scanned: %s\n", result.Timestamp.Format("2006-01-02 15:04:05"))
679679
fmt.Printf("⏱️ Discovery Time: %s\n\n", result.ComprehensiveResults.DiscoveryTime)
680680

681681
// Print comprehensive results
682-
fmt.Printf("📋 Discovery Summary:\n")
682+
fmt.Printf(" Discovery Summary:\n")
683683
fmt.Printf(" • Authentication Implementations: %d\n", len(result.ComprehensiveResults.Implementations))
684684
fmt.Printf(" • Total Endpoints: %d\n", result.ComprehensiveResults.TotalEndpoints)
685685
fmt.Printf(" • Federation Providers: %d\n", result.Summary.FederationProviders)
686686
fmt.Printf(" • Risk Score: %.1f/10\n\n", result.ComprehensiveResults.RiskScore)
687687

688688
// Print discovered implementations
689689
if len(result.ComprehensiveResults.Implementations) > 0 {
690-
fmt.Printf("🔐 Authentication Implementations:\n")
690+
fmt.Printf(" Authentication Implementations:\n")
691691
for i, impl := range result.ComprehensiveResults.Implementations {
692692
fmt.Printf(" %d. %s\n", i+1, impl.Name)
693693
fmt.Printf(" Type: %s\n", impl.Type)

cmd/boileau.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ func runboileauTool(cmd *cobra.Command, args []string) error {
186186
}
187187
options["output_dir"] = outputDir
188188

189-
fmt.Printf("🎯 Running %s against %s\n", toolName, target)
189+
fmt.Printf(" Running %s against %s\n", toolName, target)
190190
if verbose {
191-
fmt.Printf("📋 Configuration:\n")
191+
fmt.Printf(" Configuration:\n")
192192
fmt.Printf(" Output: %s\n", outputDir)
193193
fmt.Printf(" Docker: %v\n", useDocker)
194194
fmt.Printf(" Timeout: %s\n", timeout)
@@ -277,7 +277,7 @@ func runboileauTool(cmd *cobra.Command, args []string) error {
277277
log.Error("Failed to save results", "error", err)
278278
}
279279
} else {
280-
fmt.Printf(" Tool execution failed\n")
280+
fmt.Printf(" Tool execution failed\n")
281281
if result.Error != "" {
282282
fmt.Printf(" Error: %s\n", result.Error)
283283
}
@@ -315,7 +315,7 @@ func runboileauBatch(cmd *cobra.Command, args []string) error {
315315
return fmt.Errorf("failed to create output directory %s: %w", outputDir, err)
316316
}
317317

318-
fmt.Printf("🎯 Running %d tools against %s\n", len(tools), target)
318+
fmt.Printf(" Running %d tools against %s\n", len(tools), target)
319319
fmt.Printf("🛠️ Tools: %s\n", strings.Join(tools, ", "))
320320

321321
// Create scanner config

cmd/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ var configShowCmd = &cobra.Command{
152152
fmt.Printf(" %s: Configured\n", name)
153153
configured++
154154
} else {
155-
fmt.Printf(" %s: Not configured\n", name)
155+
fmt.Printf(" %s: Not configured\n", name)
156156
}
157157
}
158158

cmd/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ var deployStatusCmd = &cobra.Command{
146146
for _, component := range components {
147147
status, err := client.GetJobStatus(ctx, component)
148148
if err != nil {
149-
fmt.Printf(" %s: ERROR - %v\n", component, err)
149+
fmt.Printf(" %s: ERROR - %v\n", component, err)
150150
continue
151151
}
152152

0 commit comments

Comments
 (0)