Skip to content

Refactor processCommand method to reduce complexity#563

Merged
david-waltermire merged 15 commits intometaschema-framework:developfrom
david-waltermire:issue-252-refactor-processCommand
Dec 21, 2025
Merged

Refactor processCommand method to reduce complexity#563
david-waltermire merged 15 commits intometaschema-framework:developfrom
david-waltermire:issue-252-refactor-processCommand

Conversation

@david-waltermire
Copy link
Contributor

@david-waltermire david-waltermire commented Dec 21, 2025

Summary

  • Extract CallingContext from inner class to top-level public class for better testability
  • Add phase methods with Optional<ExitStatus> return pattern for clean flow control:
    • checkHelpAndVersion() - early exit for --help/--version
    • parseOptions() - parse all command line options
    • validateExtraArguments() - validate extra arguments
    • validateCalledCommands() - validate command chain
    • applyGlobalOptions() - apply --quiet/--no-color
  • Simplify processCommand() using Optional-based result chaining
  • Remove PMD GodClass suppression - complexity reduced through extraction
  • Update CallingContext imports across cli-processor and metaschema-cli modules

Test plan

  • All 56 cli-processor tests pass
  • Integration tests verify CLIProcessor public API behavior
  • Unit tests verify individual phase method behavior
  • TDD approach: tests written before implementation
  • Full build with -DskipTests succeeds

Closes #252

Summary by CodeRabbit

  • Refactor

    • CLI processing reorganized into phased flow so help/version are handled earlier, validation is clearer, and global options (e.g., --no-color, --quiet) apply consistently.
  • Bug Fixes

    • More consistent early-exit behavior and clearer error/help messaging for invalid commands, options, and argument validation.
  • Tests

    • Added unit and integration tests covering phase flows, option parsing, help/version output, and argument/option validation.
  • Documentation

    • Added design and implementation plan describing the refactor and rollout.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 21, 2025

📝 Walkthrough

Walkthrough

Extracts the nested CallingContext into a top-level class and refactors CLIProcessor.processCommand into six sequential phases (help/version, parse options, validate extra args, validate called commands, apply globals, invoke). Adds CallingContext implementation, updates imports/usages across commands/tests, and introduces design/implementation docs plus unit and integration tests.

Changes

Cohort / File(s) Summary
Design & Plan
PRDs/20251217-cli-processor-refactor/design.md, PRDs/20251217-cli-processor-refactor/implementation-plan.md
Adds design and implementation-plan documents describing the six-phase refactor, migration steps, testing strategy, coordination notes (shell completion), and a proposed multi-commit plan.
New CallingContext
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
Adds a top-level CallingContext that builds CLI state from args and implements phased processing (checkHelpAndVersion, parseOptions, validateExtraArguments, validateCalledCommands, applyGlobalOptions, invokeCommand), help generation, error handling, and mapping command execution to ExitStatus.
CLIProcessor updates
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java
Removes nested CallingContext, constructs new CallingContext(this, args), relaxes OPTIONS visibility to package-private, adds getOutputStream(), and relaxes visibility for handleNoColor()/handleQuiet().
Command & executor import updates
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/*, metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/**
Replaces imports of CLIProcessor.CallingContext with top-level gov.nist.secauto.metaschema.cli.processor.CallingContext; one method signature updated where a parameter referenced the nested type.
New/updated test fixtures & helpers
cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java, .../TestVersionInfo.java, TestCommandWithRequiredArg.java, TestCommandWithRequiredOption.java
Adds test command implementations and a test version provider to exercise phase logic and validation in unit and integration tests.
New tests — suites
cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java, .../CallingContextTest.java
Adds integration tests for CLIProcessor.process and unit tests for CallingContext phases (help/version, parsing, validation, globals, invocation).
Test import update
cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java
Adjusts CallingContext import to the new top-level class.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant CLIProcessor
    participant CallingContext
    participant OptionParser
    participant Commands as CommandChain
    participant Executor

    User->>CLIProcessor: process(args)
    CLIProcessor->>CallingContext: new(this, args)
    CLIProcessor->>CallingContext: processCommand()
    CallingContext->>CallingContext: checkHelpAndVersion()
    alt help/version requested
        CallingContext-->>User: print help/version + ExitStatus
    else continue
        CallingContext->>OptionParser: parseOptions(all collected options)
        OptionParser-->>CallingContext: CommandLine
        CallingContext->>CallingContext: validateExtraArguments()
        CallingContext->>Commands: validateCalledCommands()
        CallingContext->>CallingContext: applyGlobalOptions()
        CallingContext->>Commands: prepare executor for target command
        CallingContext->>Executor: invokeCommand()
        Executor-->>CallingContext: ExitStatus
        CallingContext-->>User: return ExitStatus
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Files/areas to focus review on:
    • CallingContext.java — state construction from args, phased orchestration, option aggregation, help formatting, and error → ExitStatus mappings.
    • CLIProcessor.java — changes to OPTIONS visibility, construction of CallingContext, and modified helper visibilities.
    • Cross-cutting import/signature changes where callers now reference top-level CallingContext (verify public API compatibility, e.g., ValidateModuleCommand.newExecutor).
    • New tests (CLIProcessorTest, CallingContextTest) — ensure assertions match intended behaviors and cover edge cases (help/version short-circuiting, validation errors).

Possibly related PRs

Poem

🐇 I hopped out from a nested den to clearer ground,
Six tidy hops make the CLI flow sound.
Help first, parse, check args, validate calls, globals then run —
Tests twitch their noses when the phases are done.
🌿 A neater trail, a brighter run — refactor fun.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.95% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: refactoring processCommand to reduce complexity through method extraction and simplification.
Linked Issues check ✅ Passed The PR fully addresses issue #252: extracts CallingContext to a top-level class, refactors processCommand into phase methods, removes PMD suppression, and includes comprehensive tests.
Out of Scope Changes check ✅ Passed All changes are scoped to the refactoring objective: CallingContext extraction, phase method implementation, import updates, and test additions. No unrelated modifications present.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99c6914 and 3a1d0f6.

📒 Files selected for processing (1)
  • PRDs/20251217-cli-processor-refactor/implementation-plan.md (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-13T21:16:12.281Z
Learnt from: CR
Repo: metaschema-framework/metaschema PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T21:16:12.281Z
Learning: Applies to website/content/specification/**/*.md : Use RFC 2119 keywords (MUST, SHOULD, MAY) consistently in uppercase in specification documentation

Applied to files:

  • PRDs/20251217-cli-processor-refactor/implementation-plan.md
📚 Learning: 2025-12-17T13:27:43.679Z
Learnt from: CR
Repo: metaschema-framework/metaschema-java PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T13:27:43.679Z
Learning: For larger initiatives requiring multiple PRs, use structured PRD (Product Requirements Document) approach. PRDs stored in PRDs/<YYYYMMDD>-<name>/ with PRD.md and implementation-plan.md. Target ≤50 files per PR, maximum 100 files per PR.

Applied to files:

  • PRDs/20251217-cli-processor-refactor/implementation-plan.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Website
  • GitHub Check: Code

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (6)
PRDs/20251217-cli-processor-refactor/design.md (2)

33-43: Consider adding language specifier to fenced code blocks.

The file structure diagram uses a plain fenced code block. For consistency with markdownlint rules (MD040), consider adding a language identifier like text or plaintext.

🔎 Proposed fix
-```
+```text
 cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/

47-55: Consider adding language specifier for phase flow diagram.

Same markdownlint suggestion applies here for consistency.

🔎 Proposed fix
-```
+```text
 processCommand()
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)

391-395: TODO comment for help header.

The buildHelpHeader() method currently returns null with a TODO. This appears to be a deliberate stub.

Would you like me to help implement a suitable help header, or should this remain as-is for now?

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java (1)

22-41: Well-structured integration test suite.

The test class is well-organized with clear Javadoc, nested test groups, and proper setup. The output capture mechanism using ByteArrayOutputStream allows effective validation of CLI output.

Optional: Consider adding null-safety annotations

For consistency with the project's use of SpotBugs annotations, consider adding @NonNull to the fields:

-  private CLIProcessor processor;
-  private ByteArrayOutputStream outputCapture;
+  @NonNull
+  private CLIProcessor processor;
+  @NonNull
+  private ByteArrayOutputStream outputCapture;

This is optional for test code but improves consistency across the codebase.

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java (2)

28-47: Good unit test structure for phase method validation.

The test setup is appropriate for unit testing the individual CallingContext phase methods. The createContext helper method provides a clean way to instantiate test contexts.

Optional: Add null-safety annotations to helper method

For consistency with the project's null-safety standards:

+  @NonNull
-  private CallingContext createContext(String... args) {
+  private CallingContext createContext(@NonNull String... args) {
     return new CallingContext(processor, Arrays.asList(args));
   }

This is optional for test code but improves consistency.


49-171: Comprehensive validation of phase method behavior.

The unit tests effectively validate the Optional-based phase method pattern introduced in the refactor. Each phase method (checkHelpAndVersion, parseOptions, validateExtraArguments, validateCalledCommands, applyGlobalOptions) is tested with key scenarios:

  • Success paths returning empty Optional
  • Early exit paths returning ExitStatus
  • Exception handling for invalid input

The tests confirm the refactored design works correctly and support the TDD approach mentioned in the PR objectives.

Optional: Consider expanding edge case coverage

While current coverage validates the refactor, you could optionally add tests for:

  • Multiple invalid options in ParseOptionsTests
  • Various argument validation scenarios in ValidateExtraArgumentsTests
  • Multiple command validation cases in ValidateCalledCommandsTests
  • Additional global options in ApplyGlobalOptionsTests

This would provide more comprehensive edge case coverage, but the current tests are sufficient for validating the refactored phase methods.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ddc25f6 and bbf4c80.

📒 Files selected for processing (14)
  • PRDs/20251217-cli-processor-refactor/design.md (1 hunks)
  • PRDs/20251217-cli-processor-refactor/implementation-plan.md (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (3 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractParentCommand.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommandExecutor.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestVersionInfo.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.java

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.java: All code changes must follow the Javadoc style guide (docs/javadoc-style-guide.md). New code requires 100% Javadoc coverage on public/protected members. Modified code must add/update Javadoc on any members touched. All Javadoc must include @param, @return, @throws tags in the correct order (BLOCKING)
Java target version must be Java 11. Use SpotBugs annotations (@nonnull, @nullable) for null safety in code.
Follow package naming convention gov.nist.secauto.metaschema.* for all Java packages
Follow Test-Driven Development (TDD) principles: write tests first before implementing functionality, verify tests fail with current implementation, implement minimal code to pass tests, then refactor while keeping tests green

Files:

  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommandExecutor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractParentCommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestVersionInfo.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java
**/*Test.java

📄 CodeRabbit inference engine (CLAUDE.md)

@test methods do not require Javadoc if they use descriptive method names. Use JUnit 5 for testing with parallel execution enabled.

Files:

  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java
🧠 Learnings (2)
📚 Learning: 2025-12-19T04:01:37.408Z
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 550
File: core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/JsonPointerFormatter.java:56-100
Timestamp: 2025-12-19T04:01:37.408Z
Learning: When overriding Java interface methods, rely on inherited Javadoc from the interface. Do not duplicate documentation in the implementing class unless there is implementation-specific behavior that warrants additional notes beyond the interface contract.

Applied to files:

  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommandExecutor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractParentCommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestVersionInfo.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java
📚 Learning: 2024-11-15T20:00:59.203Z
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 245
File: cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/impl/DefaultExtraArgument.java:15-15
Timestamp: 2024-11-15T20:00:59.203Z
Learning: The `DefaultExtraArgument` class in `cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/impl/DefaultExtraArgument.java` is currently a stub for future exploration.

Applied to files:

  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommandExecutor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractParentCommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java
🧬 Code graph analysis (5)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (1)
core/src/main/java/gov/nist/secauto/metaschema/core/util/ObjectUtils.java (1)
  • ObjectUtils (18-135)
🪛 markdownlint-cli2 (0.18.1)
PRDs/20251217-cli-processor-refactor/design.md

33-33: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


47-47: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

PRDs/20251217-cli-processor-refactor/implementation-plan.md

19-19: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


26-26: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


32-32: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


50-50: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


113-113: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


163-163: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


171-171: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


186-186: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


311-311: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


319-319: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


335-335: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


845-845: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


853-853: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


867-867: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


883-883: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


897-897: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


915-915: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


942-942: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


946-946: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


954-954: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


968-968: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


980-980: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


988-988: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1004-1004: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1181-1181: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1189-1189: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1203-1203: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1240-1240: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1246-1246: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1254-1254: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1268-1268: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1286-1286: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1294-1294: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1308-1308: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1337-1337: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1345-1345: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1359-1359: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1385-1385: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1393-1393: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1407-1407: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1427-1427: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1435-1435: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1449-1449: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1490-1490: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1502-1502: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1510-1510: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1518-1518: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1537-1537: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1545-1545: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1553-1553: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1561-1561: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1574-1574: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1582-1582: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1590-1590: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


1598-1598: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Code
  • GitHub Check: Website
🔇 Additional comments (29)
PRDs/20251217-cli-processor-refactor/implementation-plan.md (4)

502-502: Resolve TODO comment indicating incomplete refactoring.

Line 502 in the proposed CallingContext.processCommand() method contains // TODO: Refactor in subsequent commits. This suggests the provided code snippet is incomplete. Clarify whether this is a placeholder for illustration or whether the refactoring is genuinely deferred to a later phase.

Per the PR objectives and Task 12, the processCommand method should be fully refactored to use the extracted phase methods (checkHelpAndVersion, parseOptions, validateExtraArguments, validateCalledCommands, applyGlobalOptions) in a single implementation pass. Verify that the TODO is not needed in the final implementation.


383-383: Confirm GodClass suppression removal is feasible.

The plan assumes that extracting phase methods will reduce the GodClass warning on CallingContext (Task 13). However, CallingContext contains numerous methods beyond the extracted phases (help formatting, error handling, command invocation).

Verify during implementation that the metric actually improves enough to remove the suppression. If the warning persists, the plan may need additional extraction steps (e.g., extracting help formatting into a separate builder class).

Run PMD analysis after Task 12 refactoring to confirm whether the GodClass warning is resolved before proceeding with removal in Task 13.


149-160: Verify TestCommand constructor signature aligns with actual API.

The TestCommand fixture at lines 148–160 passes CLIProcessor.CallingContext as a type in the newExecutor method signature. Since CallingContext is being extracted to a top-level class (Task 3), ensure that the import statement and type reference in the test fixture are updated accordingly (should be CallingContext not CLIProcessor.CallingContext by Task 5).

After Task 3 (CallingContext extraction), confirm that the TestCommand test fixture is updated to import CallingContext directly rather than as a nested class reference.


226-229: Clarify CLIProcessor constructor call in integration test fixture.

The CLIProcessorTest setUp method (lines 226–229) calls a CLIProcessor constructor with three arguments: name, command version map, and PrintStream. Verify that this constructor signature exists in the actual CLIProcessor class and matches the plan's expectations.

Confirm the CLIProcessor public API supports this constructor call. If the actual constructor differs (e.g., different parameter order, different types), the test code samples in Tasks 1–2 will need adjustment.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java (1)

8-8: Import path updated correctly for top-level CallingContext.

The import change aligns with the PR's extraction of CallingContext from an inner class to a top-level class. The rest of the file remains unchanged and continues to function correctly with the new import path.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommandExecutor.java (1)

8-8: Import path updated correctly for top-level CallingContext.

The import change is consistent with the refactoring across the codebase. The CallingContext type is used in the using() factory method and ExecutionFunction interface, both of which will continue to work correctly with the top-level class.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractParentCommand.java (1)

8-8: Import path updated correctly for top-level CallingContext.

The import change aligns with the extraction refactor. The CallingContext is used appropriately in newExecutor() and executeCommand() methods.

PRDs/20251217-cli-processor-refactor/design.md (1)

1-293: Well-structured design document.

The design document comprehensively covers the refactoring objectives, including:

  • Clear problem statement and goals
  • Documented design decisions with rationale
  • Phase-based architecture with method signatures
  • Testing strategy covering both integration and unit tests
  • Risk assessment with mitigations
  • Success criteria for validation

This provides excellent documentation for the refactoring effort and future maintainability.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (5)

89-94: Visibility change for OPTIONS is appropriate.

Changing OPTIONS from private to package-private (static final) allows the extracted CallingContext class to access the global options list. This is a reasonable encapsulation trade-off for the refactoring.


227-227: CallingContext now receives CLIProcessor reference.

The constructor call now passes this to establish the relationship between CallingContext and its parent CLIProcessor. This aligns with the extraction of CallingContext to a top-level class while maintaining access to processor methods like getExec(), showVersion(), and getOutputStream().


271-274: Visibility change for handleNoColor.

Changed from private static to package-private static to allow CallingContext.applyGlobalOptions() to invoke it. This is appropriate for the refactoring.


276-284: New accessor for output stream.

The getOutputStream() method provides package-private access for CallingContext to write help output. Javadoc is present and meets guidelines.


286-298: Remove review comment - handleQuiet was never public.

Git history confirms that handleQuiet has always been package-private (static void) since its initial introduction. There is no evidence of a visibility change from public static to package-private. The method is only called internally from CallingContext.java within the same package, and no external usages exist. No breaking change has occurred.

Likely an incorrect or invalid review comment.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (9)

41-56: LGTM! Well-structured class with proper null safety annotations.

The class declaration and fields are clean with appropriate @NonNull/@Nullable annotations on all fields.


57-91: Constructor logic is sound.

The argument parsing logic correctly:

  • Handles -- as an argument terminator
  • Distinguishes options (starting with -) from commands and extra arguments
  • Builds the command chain by resolving subcommands from the hierarchy
  • Uses AtomicBoolean appropriately for mutation within the lambda

The SuppressFBWarnings for CT_CONSTRUCTOR_THROW is justified given the use of final fields.


93-149: Accessors are well-documented.

The public methods getCLIProcessor() and getTargetCommand() have proper Javadoc. Package-private methods like getOptionsList() and getCalledCommands() don't require Javadoc per coding guidelines.


151-180: Phase 1 method correctly isolates help/version checking.

The method properly uses stopAtNonOption=true to only check for help/version flags before full parsing. The Optional<ExitStatus> return type enables clean early-exit flow control.


182-195: Phase 2 parsing is clean and straightforward.

Properly delegates to DefaultParser and declares ParseException for caller handling.


197-244: Validation phases are well-structured.

Both methods correctly:

  • Return Optional.empty() to continue processing on success
  • Return Optional.of(ExitStatus) on validation failure
  • Delegate to command-specific validation logic

The assert msg != null at line 239 is acceptable since InvalidArgumentException should always carry a message.


246-296: Excellent use of Optional chaining for phase orchestration.

The processCommand() method cleanly chains the validation phases using Optional.or(), providing readable short-circuit evaluation. This is a significant improvement in code clarity compared to nested conditionals.


345-384: Error handling methods are well-designed.

Both handleError() and handleInvalidCommand() have complete Javadoc with all required tags and provide clear separation of concerns for error presentation.


541-569: Help output implementation is robust.

The showHelp() method correctly:

  • Detects terminal width from AnsiPrintStream with fallback to 80 columns
  • Uses Math.max(terminalWidth, 50) to ensure minimum readable width
  • Properly manages the PrintWriter lifecycle with try-with-resources
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java (1)

8-9: Import update aligns with CallingContext extraction.

The import path correctly references the new top-level CallingContext class.

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java (2)

11-11: Import update correctly references top-level CallingContext.

The import path change aligns with the refactor.


271-275: Mock commands are appropriate for generator testing.

The mock commands returning null from newExecutor() is acceptable since these tests focus on completion script generation, not command execution. The mocks provide the necessary option and argument metadata for the generator tests.

Also applies to: 317-320

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java (1)

8-8: Import correctly updated for top-level CallingContext.

The interface now references the extracted CallingContext class from the processor package.

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestVersionInfo.java (1)

12-57: Well-implemented test utility following established patterns.

The TestVersionInfo class correctly:

  • Is package-private for test-only visibility
  • Implements IVersionInfo with deterministic fixed values
  • Uses @NonNull annotations on all return values
  • Relies on inherited Javadoc from the interface (per project conventions)

This enables consistent, reproducible version information in tests.

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java (1)

43-121: Comprehensive integration test coverage.

The test methods cover the key integration scenarios for the refactored CLIProcessor:

  • Global options (--version, --help, --quiet)
  • Valid and invalid command execution paths
  • Edge cases (empty args, unknown commands, invalid options)

The use of assertAll for grouped assertions and consistent exit code validation demonstrates good testing practices. Test method names are descriptive and don't require Javadoc per project guidelines.

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java (1)

15-44: Clean test fixture implementation with proper null-safety annotations.

This minimal command implementation serves its purpose as a test fixture effectively. The code properly:

  • Uses @NonNull annotations on all method parameters and return values
  • Relies on inherited Javadoc from the interface (per project learnings)
  • Implements a no-op command execution suitable for testing

The package-private visibility and simple implementation are appropriate for a test utility class.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
PRDs/20251217-cli-processor-refactor/implementation-plan.md (1)

986-986: Consider making repeated heading names more specific.

Multiple sections use identical heading text (e.g., "### Step 3: Commit" appears in Tasks 4, 7, 9, 10, 11). This creates navigation challenges in editors and violates MD024. Consider appending task context to make each unique (e.g., "### Step 3: Commit CallingContext extraction").

Example transformation
-### Step 3: Commit
+### Step 3: Commit ShellCompletionCommand import update

Also applies to lines 1343, 1391, 1433.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)

123-126: Add Javadoc for consistency with other package-private methods.

While not strictly required by the guidelines (which mandate Javadoc for public/protected members only), this package-private method lacks documentation whereas other package-private methods (getOptionsList, getExtraArgs, toOptions) include Javadoc. Adding a brief description would improve consistency and maintainability.

📝 Suggested Javadoc
+  /**
+   * Get the chain of commands that were invoked.
+   *
+   * @return the list of called commands in order
+   */
   @NonNull
   List<ICommand> getCalledCommands() {
     return calledCommands;
   }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e542b62 and 75f4ed2.

📒 Files selected for processing (2)
  • PRDs/20251217-cli-processor-refactor/implementation-plan.md (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.java

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.java: All code changes must follow the Javadoc style guide (docs/javadoc-style-guide.md). New code requires 100% Javadoc coverage on public/protected members. Modified code must add/update Javadoc on any members touched. All Javadoc must include @param, @return, @throws tags in the correct order (BLOCKING)
Java target version must be Java 11. Use SpotBugs annotations (@nonnull, @nullable) for null safety in code.
Follow package naming convention gov.nist.secauto.metaschema.* for all Java packages
Follow Test-Driven Development (TDD) principles: write tests first before implementing functionality, verify tests fail with current implementation, implement minimal code to pass tests, then refactor while keeping tests green

Files:

  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
🧠 Learnings (3)
📚 Learning: 2025-12-13T21:16:12.281Z
Learnt from: CR
Repo: metaschema-framework/metaschema PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T21:16:12.281Z
Learning: Applies to website/content/specification/**/*.md : Use RFC 2119 keywords (MUST, SHOULD, MAY) consistently in uppercase in specification documentation

Applied to files:

  • PRDs/20251217-cli-processor-refactor/implementation-plan.md
📚 Learning: 2024-11-15T20:00:59.203Z
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 245
File: cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/impl/DefaultExtraArgument.java:15-15
Timestamp: 2024-11-15T20:00:59.203Z
Learning: The `DefaultExtraArgument` class in `cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/impl/DefaultExtraArgument.java` is currently a stub for future exploration.

Applied to files:

  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
📚 Learning: 2025-12-19T04:01:37.408Z
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 550
File: core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/JsonPointerFormatter.java:56-100
Timestamp: 2025-12-19T04:01:37.408Z
Learning: When overriding Java interface methods, rely on inherited Javadoc from the interface. Do not duplicate documentation in the implementing class unless there is implementation-specific behavior that warrants additional notes beyond the interface contract.

Applied to files:

  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
🧬 Code graph analysis (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (5)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/CommandExecutionException.java (1)
  • CommandExecutionException (16-99)
core/src/main/java/gov/nist/secauto/metaschema/core/util/AutoCloser.java (1)
  • AutoCloser (26-136)
core/src/main/java/gov/nist/secauto/metaschema/core/util/ObjectUtils.java (1)
  • ObjectUtils (18-135)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (1)
  • SuppressWarnings (42-321)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/OptionUtils.java (1)
  • OptionUtils (15-33)
🪛 markdownlint-cli2 (0.18.1)
PRDs/20251217-cli-processor-refactor/implementation-plan.md

986-986: Multiple headings with the same content

(MD024, no-duplicate-heading)


1343-1343: Multiple headings with the same content

(MD024, no-duplicate-heading)


1391-1391: Multiple headings with the same content

(MD024, no-duplicate-heading)


1433-1433: Multiple headings with the same content

(MD024, no-duplicate-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Website
  • GitHub Check: Code
🔇 Additional comments (2)
PRDs/20251217-cli-processor-refactor/implementation-plan.md (1)

336-336: Implementation uses public visibility instead of package-private.

The plan specifies "adding package-private visibility" (line 336) and shows class CallingContext without a modifier (line 382), but the actual implementation declares public class CallingContext. While public visibility may be intentional for testability or API design, this discrepancy between plan and implementation should be noted.

Also applies to: 382-382

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)

269-296: Excellent refactoring—complexity successfully reduced.

The phase-based decomposition with Optional chaining makes the command processing flow clear and maintainable. The elimination of PMD complexity suppressions demonstrates that the refactoring achieved its goal of reducing cyclomatic complexity.

Document the approach for issue metaschema-framework#252 to refactor the processCommand
method in CLIProcessor.java. Key decisions:
- Extract CallingContext to top-level package-private class
- Use Optional-based result chaining for phase flow
- Add both integration and unit tests
- Use protected methods for testability
Detailed bite-sized tasks for:
- Test infrastructure setup
- CallingContext extraction
- Phase method extraction
- processCommand refactoring
- PMD warning removal
- Create CallingContext.java as a separate top-level class
- Update CLIProcessor to use the extracted CallingContext
- Add getOutputStream() method to CLIProcessor for CallingContext access
- Make OPTIONS and handleNoColor/handleQuiet package-private
- Update all imports from CLIProcessor.CallingContext to CallingContext
- Fixes part of metaschema-framework#252
- Test --version option shows version info
- Test --help option shows help
- Test --quiet option is accepted
- Test valid command execution
- Test unknown command returns INVALID_COMMAND
- Test invalid option returns INVALID_COMMAND
- Test empty args returns INVALID_COMMAND with help
Tests for phase methods that will be extracted:
- checkHelpAndVersion() - check for --help/--version before parsing
- parseOptions() - parse all command line options
- validateExtraArguments() - validate extra arguments for target command
- validateCalledCommands() - validate options for all called commands
- applyGlobalOptions() - apply --no-color and --quiet options
Add protected phase methods that will be used by refactored processCommand:
- checkHelpAndVersion() - check for --help/--version before parsing
- parseOptions() - parse all command line options
- validateExtraArguments() - validate extra arguments for target command
- validateCalledCommands() - validate options for all called commands
- applyGlobalOptions() - apply --no-color and --quiet options

All CallingContextTest unit tests now pass.
Replace inline logic with calls to focused phase methods:
- checkHelpAndVersion() for early exit on --help/--version
- parseOptions() for full option parsing
- validateExtraArguments() and validateCalledCommands() chained with Optional.or()
- applyGlobalOptions() for --no-color/--quiet handling

Removes PMD suppressions for NPathComplexity and CyclomaticComplexity.
The GodClass warning is now a priority 3 (non-blocking) violation.
The refactoring reduced complexity significantly by extracting phase methods.
Update 9 files in metaschema-cli to use the new top-level
CallingContext class instead of the removed inner class
CLIProcessor.CallingContext.
- Fix typo 'occured' -> 'occurred' in error message
- Remove AI instruction metadata from implementation plan
- Convert bold step headers to markdown headings
- Add language specifier to design.md code blocks
- Add @nonnull annotations to test fields and helper methods
@david-waltermire david-waltermire force-pushed the issue-252-refactor-processCommand branch from a6a62bb to e24daea Compare December 21, 2025 18:41
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (5)
cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java (3)

116-142: Consider adding negative test case for invalid extra arguments.

The design document specifies testing "Returns error when arguments invalid" for validateExtraArguments(). Consider adding a test with a command that requires arguments but receives none, to verify the error path returns an ExitStatus.


144-159: Consider adding negative test case for invalid command options.

Per the design specification, validateCalledCommands() should also be tested with "Returns error on first invalid command". A test with a command that has required options missing would exercise this path.


161-174: Consider adding test for --no-color option.

The design document lists testing both --no-color and --quiet options. Adding a test case for --no-color would provide complete coverage of applyGlobalOptions().

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (2)

123-126: Missing Javadoc on getCalledCommands() method.

For consistency with other package-private accessors like getOptionsList() and getExtraArgs(), consider adding Javadoc to getCalledCommands().

🔎 Proposed fix
+  /**
+   * Get the chain of commands that were called.
+   *
+   * @return the list of called commands
+   */
   @NonNull
   List<ICommand> getCalledCommands() {
     return calledCommands;
   }

386-395: TODO comment in buildHelpHeader().

The method contains a TODO comment indicating this is a placeholder. If a help header is not needed, consider removing the TODO or documenting why the header is intentionally null.

Would you like me to help implement a suitable help header, or should the TODO be removed if no header is needed?

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 75f4ed2 and e24daea.

📒 Files selected for processing (23)
  • PRDs/20251217-cli-processor-refactor/design.md (1 hunks)
  • PRDs/20251217-cli-processor-refactor/implementation-plan.md (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (3 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractParentCommand.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommandExecutor.java (1 hunks)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestVersionInfo.java (1 hunks)
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ConvertContentUsingModuleCommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateDiagramCommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateContentUsingModuleCommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java (1 hunks)
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommandExecutor.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessorTest.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ConvertContentUsingModuleCommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/completion/CompletionScriptGeneratorTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractParentCommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateContentUsingModuleCommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestVersionInfo.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractValidateContentCommand.java
🧰 Additional context used
📓 Path-based instructions (3)
**/*.java

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.java: All code changes must follow the Javadoc style guide (docs/javadoc-style-guide.md). New code requires 100% Javadoc coverage on public/protected members. Modified code must add/update Javadoc on any members touched. All Javadoc must include @param, @return, @throws tags in the correct order (BLOCKING)
Java target version must be Java 11. Use SpotBugs annotations (@nonnull, @nullable) for null safety in code.
Follow package naming convention gov.nist.secauto.metaschema.* for all Java packages
Follow Test-Driven Development (TDD) principles: write tests first before implementing functionality, verify tests fail with current implementation, implement minimal code to pass tests, then refactor while keeping tests green

Files:

  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateDiagramCommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java
**/metapath/**/*.java

📄 CodeRabbit inference engine (CLAUDE.md)

Metapath is an implementation of XPath 3.1. Use the XPath 3.1 specification (https://www.w3.org/TR/xpath-31/) and XPath Functions 3.1 (https://www.w3.org/TR/xpath-functions-31/) as authoritative reference when implementing new functions, fixing bugs, or understanding error handling. Raise clarification before making changes if implementation differs from spec.

Files:

  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java
**/*Test.java

📄 CodeRabbit inference engine (CLAUDE.md)

@test methods do not require Javadoc if they use descriptive method names. Use JUnit 5 for testing with parallel execution enabled.

Files:

  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java
🧠 Learnings (7)
📚 Learning: 2025-12-19T04:01:37.408Z
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 550
File: core/src/main/java/gov/nist/secauto/metaschema/core/metapath/format/JsonPointerFormatter.java:56-100
Timestamp: 2025-12-19T04:01:37.408Z
Learning: When overriding Java interface methods, rely on inherited Javadoc from the interface. Do not duplicate documentation in the implementing class unless there is implementation-specific behavior that warrants additional notes beyond the interface contract.

Applied to files:

  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateDiagramCommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java
📚 Learning: 2024-11-15T20:00:59.203Z
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 245
File: cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/impl/DefaultExtraArgument.java:15-15
Timestamp: 2024-11-15T20:00:59.203Z
Learning: The `DefaultExtraArgument` class in `cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/impl/DefaultExtraArgument.java` is currently a stub for future exploration.

Applied to files:

  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java
  • cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java
  • cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java
📚 Learning: 2025-12-17T13:27:43.679Z
Learnt from: CR
Repo: metaschema-framework/metaschema-java PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T13:27:43.679Z
Learning: Applies to **/metapath/**/*.java : Metapath is an implementation of XPath 3.1. Use the XPath 3.1 specification (https://www.w3.org/TR/xpath-31/) and XPath Functions 3.1 (https://www.w3.org/TR/xpath-functions-31/) as authoritative reference when implementing new functions, fixing bugs, or understanding error handling. Raise clarification before making changes if implementation differs from spec.

Applied to files:

  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java
  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java
📚 Learning: 2025-12-17T13:27:43.679Z
Learnt from: CR
Repo: metaschema-framework/metaschema-java PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T13:27:43.679Z
Learning: For larger initiatives requiring multiple PRs, use structured PRD (Product Requirements Document) approach. PRDs stored in PRDs/<YYYYMMDD>-<name>/ with PRD.md and implementation-plan.md. Target ≤50 files per PR, maximum 100 files per PR.

Applied to files:

  • PRDs/20251217-cli-processor-refactor/implementation-plan.md
📚 Learning: 2025-12-13T21:16:12.281Z
Learnt from: CR
Repo: metaschema-framework/metaschema PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T21:16:12.281Z
Learning: Applies to website/content/specification/**/*.md : Use RFC 2119 keywords (MUST, SHOULD, MAY) consistently in uppercase in specification documentation

Applied to files:

  • PRDs/20251217-cli-processor-refactor/implementation-plan.md
📚 Learning: 2025-12-17T13:27:43.679Z
Learnt from: CR
Repo: metaschema-framework/metaschema-java PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T13:27:43.679Z
Learning: Applies to core/src/main/antlr4/** : Metapath parser is generated from ANTLR4 grammar files in core/src/main/antlr4. Code generation occurs during Maven build producing output in target/generated-sources/

Applied to files:

  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java
📚 Learning: 2025-01-07T00:50:46.218Z
Learnt from: david-waltermire
Repo: metaschema-framework/metaschema-java PR: 336
File: core/src/main/java/gov/nist/secauto/metaschema/core/metapath/cst/type/InstanceOf.java:87-88
Timestamp: 2025-01-07T00:50:46.218Z
Learning: In the Metapath implementation, child expressions should be called using `accept()` rather than `evaluate()` to ensure proper management of the execution stack through push/pop operations. The `evaluate()` method is an internal implementation detail that performs the actual evaluation.

Applied to files:

  • metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java
🧬 Code graph analysis (10)
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateDiagramCommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (5)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/CommandExecutionException.java (1)
  • CommandExecutionException (16-99)
core/src/main/java/gov/nist/secauto/metaschema/core/util/AutoCloser.java (1)
  • AutoCloser (26-136)
core/src/main/java/gov/nist/secauto/metaschema/core/util/ObjectUtils.java (1)
  • ObjectUtils (18-135)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (1)
  • SuppressWarnings (42-321)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/OptionUtils.java (1)
  • OptionUtils (15-33)
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (1)
core/src/main/java/gov/nist/secauto/metaschema/core/util/ObjectUtils.java (1)
  • ObjectUtils (18-135)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (1)
  • CallingContext (45-570)
cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java (1)
cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractTerminalCommand.java (1)
  • AbstractTerminalCommand (24-94)
🪛 markdownlint-cli2 (0.18.1)
PRDs/20251217-cli-processor-refactor/implementation-plan.md

986-986: Multiple headings with the same content

(MD024, no-duplicate-heading)


1343-1343: Multiple headings with the same content

(MD024, no-duplicate-heading)


1391-1391: Multiple headings with the same content

(MD024, no-duplicate-heading)


1433-1433: Multiple headings with the same content

(MD024, no-duplicate-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Code
  • GitHub Check: Website
🔇 Additional comments (23)
metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/ListFunctionsSubcommand.java (1)

8-8: LGTM! Clean import refactoring.

The import path update from CLIProcessor.CallingContext to the top-level CallingContext aligns with the PR's objective to extract CallingContext for improved testability and reduced complexity.

metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/metapath/EvaluateMetapathCommand.java (1)

9-9: LGTM! Import path correctly updated.

The import change is consistent with the CallingContext extraction refactoring across the codebase.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CLIProcessor.java (5)

89-94: LGTM! Appropriate visibility relaxation.

Changing OPTIONS from private to package-private enables the extracted CallingContext class to access it while maintaining proper encapsulation at the package boundary.


227-227: LGTM! Constructor updated for extracted CallingContext.

Passing this as the first parameter aligns with the new CallingContext constructor signature that requires a reference to the CLIProcessor instance.


271-274: LGTM! Visibility adjusted for package access.

Reducing visibility from private to package-private allows CallingContext to call this method while maintaining encapsulation.


276-284: LGTM! Well-documented accessor method.

The new getOutputStream() method follows coding guidelines with proper Javadoc including the @return tag. Package-private visibility is appropriate for CallingContext's needs.


289-298: LGTM! Visibility reduction improves API encapsulation.

Changing handleQuiet() from public to package-private narrows the public API surface while still allowing CallingContext access. This is a beneficial side effect of the refactoring.

metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateSchemaCommand.java (1)

8-8: LGTM! Import refactoring applied consistently.

The import update is part of the coordinated effort to extract CallingContext to a top-level class.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ShellCompletionCommand.java (1)

9-9: LGTM! Import path updated correctly.

The change correctly references the top-level CallingContext class.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/AbstractCommandExecutor.java (1)

8-8: LGTM! Import updated for extracted CallingContext.

The import change is consistent with the refactoring that extracts CallingContext to a top-level class.

metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/GenerateDiagramCommand.java (1)

8-8: LGTM! Import refactoring applied.

The import path update correctly references the top-level CallingContext class as part of the complexity reduction refactoring.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/command/ICommand.java (1)

8-8: LGTM! Import updated for interface contract.

The import change maintains consistency across the command interface while supporting the CallingContext extraction refactoring.

metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/AbstractConvertSubcommand.java (1)

8-8: Import update aligns with CallingContext extraction.

The import path change from CLIProcessor.CallingContext to the top-level CallingContext is consistent with the refactoring objective. The usage throughout the file remains correct.

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/CallingContextTest.java (1)

47-50: Helper method correctly creates test context.

The helper method is well-designed for test readability. The @NonNull annotation is appropriately applied.

metaschema-cli/src/main/java/gov/nist/secauto/metaschema/cli/commands/ValidateModuleCommand.java (1)

8-8: Import update consistent with CallingContext extraction.

The import path change aligns with the refactoring. Usage in newExecutor() and CommandExecutor constructor remains correct.

cli-processor/src/test/java/gov/nist/secauto/metaschema/cli/processor/TestCommand.java (1)

18-45: Clean test fixture implementation.

The TestCommand class is a minimal, well-structured test fixture. It correctly uses the top-level CallingContext, has appropriate Javadoc, and follows the command pattern established by AbstractTerminalCommand.

PRDs/20251217-cli-processor-refactor/design.md (1)

1-293: Comprehensive design document.

The design document is well-structured with clear goals, architecture diagrams, phase flow, implementation details, testing strategy, and success criteria. It provides excellent documentation for the refactoring effort.

cli-processor/src/main/java/gov/nist/secauto/metaschema/cli/processor/CallingContext.java (6)

45-45: Class visibility changed from package-private to public.

The design document and implementation plan specified CallingContext as package-private, but it's now public. This is likely intentional to allow commands in other packages (like metaschema-cli) to receive it as a parameter. The change is acceptable but worth noting for documentation accuracy.

Please confirm this visibility change was intentional for cross-package command support.


57-91: Well-structured constructor with correct argument parsing.

The constructor correctly:

  • Uses AtomicBoolean for mutable state in lambda
  • Handles the -- argument separator
  • Builds the command chain and gathers options
  • Creates unmodifiable views for all collections

151-261: Phase methods correctly implement the design specification.

The five phase methods (checkHelpAndVersion, parseOptions, validateExtraArguments, validateCalledCommands, applyGlobalOptions) are well-documented and correctly implement the Optional-based flow control pattern described in the design document.


263-296: Clean processCommand implementation with reduced complexity.

The refactored processCommand() method successfully reduces complexity by delegating to focused phase methods. The Optional-based chaining at lines 287-288 is idiomatic Java and provides clean flow control.


305-343: Robust error handling in invokeCommand().

The method correctly handles:

  • Missing target command (returns INVALID_COMMAND)
  • CommandExecutionException (converts to ExitStatus)
  • Unexpected RuntimeException (wraps with RUNTIME_ERROR)

The typo "occured" was correctly fixed to "occurred" as noted in past reviews.


541-569: Correct use of AutoCloser.preventClose() for output stream.

The showHelp() method correctly wraps the output stream with AutoCloser.preventClose() to prevent closing the underlying System.out stream when the PrintWriter is closed.

- ParseOptionsTests: multiple invalid options
- ValidateExtraArgumentsTests: required argument missing, too many arguments
- ValidateCalledCommandsTests: required option missing/provided
- ApplyGlobalOptionsTests: --no-color, both --quiet and --no-color

Added test fixtures:
- TestCommandWithRequiredArg: command requiring an extra argument
- TestCommandWithRequiredOption: command requiring a specific option
- Update TestCommand to use CallingContext instead of CLIProcessor.CallingContext
- Add @nonnull annotations to createContext helper method
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
PRDs/20251217-cli-processor-refactor/implementation-plan.md (1)

985-985: Address duplicate markdown heading names flagged by linter (MD024).

The markdown linter reports multiple sections with identical heading text ("### Step 3: Commit", "### Step 2: Run tests", etc.), which violates the MD024 no-duplicate-heading rule.

These repetitions occur across different task sections (Tasks 5, 9, 10, 11). To resolve this while maintaining document structure, consider:

  • Qualifying headings with task context, e.g., "### Step 3: Commit phase method" or "### Step 3: Commit validateExtraArguments"
  • Using uniquely descriptive step names per task section

This is a minor documentation quality issue; the current structure is functionally clear but should align with markdown style standards.

Also applies to: 1343-1343, 1391-1391, 1433-1433

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8dd8f72 and 99c6914.

📒 Files selected for processing (1)
  • PRDs/20251217-cli-processor-refactor/implementation-plan.md (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-17T13:27:43.679Z
Learnt from: CR
Repo: metaschema-framework/metaschema-java PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-17T13:27:43.679Z
Learning: For larger initiatives requiring multiple PRs, use structured PRD (Product Requirements Document) approach. PRDs stored in PRDs/<YYYYMMDD>-<name>/ with PRD.md and implementation-plan.md. Target ≤50 files per PR, maximum 100 files per PR.

Applied to files:

  • PRDs/20251217-cli-processor-refactor/implementation-plan.md
📚 Learning: 2025-12-13T21:16:12.281Z
Learnt from: CR
Repo: metaschema-framework/metaschema PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-13T21:16:12.281Z
Learning: Applies to website/content/specification/**/*.md : Use RFC 2119 keywords (MUST, SHOULD, MAY) consistently in uppercase in specification documentation

Applied to files:

  • PRDs/20251217-cli-processor-refactor/implementation-plan.md
🪛 markdownlint-cli2 (0.18.1)
PRDs/20251217-cli-processor-refactor/implementation-plan.md

985-985: Multiple headings with the same content

(MD024, no-duplicate-heading)


1343-1343: Multiple headings with the same content

(MD024, no-duplicate-heading)


1391-1391: Multiple headings with the same content

(MD024, no-duplicate-heading)


1433-1433: Multiple headings with the same content

(MD024, no-duplicate-heading)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Code
  • GitHub Check: Website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor 'processCommand' method in CLIProcessor.java to reduce complexity

1 participant