codedd-cli 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. codedd_cli/__init__.py +1 -1
  2. codedd_cli/api/client.py +8 -6
  3. codedd_cli/api/endpoints.py +2 -0
  4. codedd_cli/api/exceptions.py +0 -1
  5. codedd_cli/auditor/architecture_analyzer.py +1220 -272
  6. codedd_cli/auditor/architecture_prompts.py +72 -2
  7. codedd_cli/auditor/commit_classifier.py +350 -0
  8. codedd_cli/auditor/complexity_analyzer.py +1357 -249
  9. codedd_cli/auditor/dependency_scanner.py +227 -134
  10. codedd_cli/auditor/enhanced_architecture_detectors.py +381 -0
  11. codedd_cli/auditor/file_auditor.py +36 -27
  12. codedd_cli/auditor/git_stats_collector.py +471 -92
  13. codedd_cli/auditor/response_parser.py +35 -38
  14. codedd_cli/auditor/sub_audit_runner.py +601 -0
  15. codedd_cli/auditor/vulnerability_validator.py +101 -43
  16. codedd_cli/auth/__init__.py +1 -1
  17. codedd_cli/auth/session.py +2 -3
  18. codedd_cli/auth/token_manager.py +1 -2
  19. codedd_cli/cli.py +2 -2
  20. codedd_cli/commands/audit_cmd.py +501 -1087
  21. codedd_cli/commands/audits_cmd.py +13 -10
  22. codedd_cli/commands/auth_cmd.py +14 -9
  23. codedd_cli/commands/config_cmd.py +25 -58
  24. codedd_cli/commands/scope_cmd.py +346 -58
  25. codedd_cli/config/__init__.py +1 -1
  26. codedd_cli/config/constants.py +1 -1
  27. codedd_cli/config/settings.py +38 -18
  28. codedd_cli/llm/key_manager.py +3 -7
  29. codedd_cli/models/__init__.py +1 -1
  30. codedd_cli/models/audit.py +3 -4
  31. codedd_cli/models/local_directory.py +0 -1
  32. codedd_cli/scanner/__init__.py +1 -1
  33. codedd_cli/scanner/file_classifier.py +640 -135
  34. codedd_cli/scanner/file_walker.py +20 -14
  35. codedd_cli/scanner/line_counter.py +13 -8
  36. codedd_cli/utils/directory_validator.py +2 -3
  37. codedd_cli/utils/display.py +313 -19
  38. codedd_cli/utils/payload_inspector.py +4 -6
  39. codedd_cli/utils/validators.py +1 -1
  40. {codedd_cli-0.1.0.dist-info → codedd_cli-0.1.2.dist-info}/METADATA +70 -38
  41. codedd_cli-0.1.2.dist-info/RECORD +52 -0
  42. codedd_cli-0.1.0.dist-info/RECORD +0 -49
  43. {codedd_cli-0.1.0.dist-info → codedd_cli-0.1.2.dist-info}/WHEEL +0 -0
  44. {codedd_cli-0.1.0.dist-info → codedd_cli-0.1.2.dist-info}/entry_points.txt +0 -0
  45. {codedd_cli-0.1.0.dist-info → codedd_cli-0.1.2.dist-info}/licenses/LICENSE +0 -0
codedd_cli/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """CodeDD CLI — run code audits from your terminal."""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.2"
codedd_cli/api/client.py CHANGED
@@ -10,7 +10,7 @@ Wraps ``httpx`` with:
10
10
  """
11
11
 
12
12
  import time
13
- from typing import Any, Optional
13
+ from typing import Any
14
14
 
15
15
  import httpx
16
16
 
@@ -36,15 +36,17 @@ class CodeDDClient:
36
36
  data = resp.json()
37
37
  """
38
38
 
39
- def __init__(self, config: Optional[ConfigManager] = None) -> None:
39
+ def __init__(self, config: ConfigManager | None = None) -> None:
40
40
  self._config = config or ConfigManager()
41
41
  self._base_url = self._config.api_url.rstrip("/")
42
42
  self._token = TokenManager.retrieve()
43
-
43
+
44
44
  # For localhost HTTP, disable TLS verification (not applicable anyway)
45
45
  # For HTTPS, always verify certificates
46
- verify_tls = not self._base_url.startswith("http://localhost") and not self._base_url.startswith("http://127.0.0.1")
47
-
46
+ verify_tls = not self._base_url.startswith("http://localhost") and not self._base_url.startswith(
47
+ "http://127.0.0.1"
48
+ )
49
+
48
50
  self._client = httpx.Client(
49
51
  base_url=self._base_url,
50
52
  headers=self._build_headers(),
@@ -79,7 +81,7 @@ class CodeDDClient:
79
81
  Retries on 5xx responses and connection errors using exponential
80
82
  back-off (1s, 2s, 4s …).
81
83
  """
82
- last_exc: Optional[Exception] = None
84
+ last_exc: Exception | None = None
83
85
 
84
86
  for attempt in range(1, MAX_RETRIES + 1):
85
87
  try:
@@ -17,6 +17,7 @@ class Endpoints:
17
17
  # Scope
18
18
  REGISTER_SCOPE = "/api/cli/scope/register/"
19
19
  SCOPE_FILES = "/api/cli/scope/files/"
20
+ DELETE_REPO_FROM_SCOPE = "/delete_repo_from_scope/"
20
21
 
21
22
  # Audit lifecycle
22
23
  AUDIT_CAN_START = "/api/cli/audit/can-start/"
@@ -38,6 +39,7 @@ class Endpoints:
38
39
 
39
40
  # Local git statistics (for CLI-driven audits; enables dashboards)
40
41
  AUDIT_GIT_STATISTICS = "/api/cli/audit/git-statistics/"
42
+ AUDIT_GIT_DEVELOPMENT_ANALYSIS = "/api/cli/audit/git-development-analysis/"
41
43
  AUDIT_VULNERABILITY_VALIDATION = "/api/cli/audit/vulnerability-validation/"
42
44
 
43
45
  # Architecture analysis (Phase 1+2 run locally; server runs Phase 3 + storage)
@@ -6,7 +6,6 @@ timeout, server disconnected, etc.). Handled at the CLI entry point to
6
6
  display a single, clear message instead of a full traceback.
7
7
  """
8
8
 
9
-
10
9
  # Pre-defined message shown when the remote is not responding.
11
10
  CONNECTION_ERROR_MESSAGE = (
12
11
  "Unable to reach CodeDD. "