codedd-cli 0.1.1__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 (49) hide show
  1. codedd_cli/__init__.py +3 -0
  2. codedd_cli/__main__.py +19 -0
  3. codedd_cli/api/__init__.py +4 -0
  4. codedd_cli/api/client.py +120 -0
  5. codedd_cli/api/endpoints.py +44 -0
  6. codedd_cli/api/exceptions.py +24 -0
  7. codedd_cli/auditor/__init__.py +6 -0
  8. codedd_cli/auditor/architecture_analyzer.py +1251 -0
  9. codedd_cli/auditor/architecture_prompts.py +173 -0
  10. codedd_cli/auditor/complexity_analyzer.py +1739 -0
  11. codedd_cli/auditor/dependency_scanner.py +2485 -0
  12. codedd_cli/auditor/file_auditor.py +578 -0
  13. codedd_cli/auditor/git_stats_collector.py +417 -0
  14. codedd_cli/auditor/response_parser.py +484 -0
  15. codedd_cli/auditor/vulnerability_validator.py +323 -0
  16. codedd_cli/auth/__init__.py +4 -0
  17. codedd_cli/auth/session.py +40 -0
  18. codedd_cli/auth/token_manager.py +86 -0
  19. codedd_cli/cli.py +69 -0
  20. codedd_cli/commands/__init__.py +1 -0
  21. codedd_cli/commands/audit_cmd.py +1987 -0
  22. codedd_cli/commands/audits_cmd.py +276 -0
  23. codedd_cli/commands/auth_cmd.py +235 -0
  24. codedd_cli/commands/config_cmd.py +421 -0
  25. codedd_cli/commands/scope_cmd.py +1016 -0
  26. codedd_cli/config/__init__.py +4 -0
  27. codedd_cli/config/constants.py +22 -0
  28. codedd_cli/config/settings.py +389 -0
  29. codedd_cli/llm/__init__.py +1 -0
  30. codedd_cli/llm/key_manager.py +267 -0
  31. codedd_cli/models/__init__.py +5 -0
  32. codedd_cli/models/account.py +13 -0
  33. codedd_cli/models/audit.py +31 -0
  34. codedd_cli/models/local_directory.py +25 -0
  35. codedd_cli/scanner/__init__.py +18 -0
  36. codedd_cli/scanner/file_classifier.py +752 -0
  37. codedd_cli/scanner/file_walker.py +213 -0
  38. codedd_cli/scanner/line_counter.py +80 -0
  39. codedd_cli/utils/__init__.py +1 -0
  40. codedd_cli/utils/directory_validator.py +178 -0
  41. codedd_cli/utils/display.py +497 -0
  42. codedd_cli/utils/payload_inspector.py +178 -0
  43. codedd_cli/utils/security.py +14 -0
  44. codedd_cli/utils/validators.py +37 -0
  45. codedd_cli-0.1.1.dist-info/METADATA +306 -0
  46. codedd_cli-0.1.1.dist-info/RECORD +49 -0
  47. codedd_cli-0.1.1.dist-info/WHEEL +4 -0
  48. codedd_cli-0.1.1.dist-info/entry_points.txt +3 -0
  49. codedd_cli-0.1.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,13 @@
1
+ """Data model for account information returned by the API."""
2
+
3
+ from dataclasses import dataclass
4
+
5
+
6
+ @dataclass(frozen=True)
7
+ class AccountInfo:
8
+ """Minimal account information returned after token verification."""
9
+
10
+ account_uuid: str
11
+ account_name: str
12
+ email: str # Masked by the server (e.g. j***@example.com)
13
+ token_name: str = ""
@@ -0,0 +1,31 @@
1
+ """Data models for audit entities returned by the CLI API."""
2
+
3
+ from dataclasses import dataclass
4
+
5
+
6
+ @dataclass(frozen=True)
7
+ class Audit:
8
+ """A single-repository audit."""
9
+
10
+ audit_uuid: str
11
+ audit_name: str
12
+ audit_status: str
13
+ audit_type: str = "single"
14
+ ai_synthesis: str | None = None
15
+ repo_url: str = ""
16
+ number_files: int = 0
17
+ lines_of_code: int = 0
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class GroupAudit:
22
+ """A group audit (portfolio / multi-repo)."""
23
+
24
+ audit_uuid: str
25
+ audit_name: str
26
+ audit_status: str
27
+ audit_type: str = "group"
28
+ ai_synthesis: str | None = None
29
+ number_of_sub_audits: int = 0
30
+ number_files: int = 0
31
+ lines_of_code: int = 0
@@ -0,0 +1,25 @@
1
+ """Data model for a validated local directory added to an audit scope."""
2
+
3
+ from dataclasses import dataclass
4
+
5
+
6
+ @dataclass
7
+ class LocalDirectory:
8
+ """
9
+ Represents a validated local Git repository directory.
10
+
11
+ Attributes:
12
+ path: Absolute path to the directory.
13
+ repo_name: Short name derived from the directory basename.
14
+ branch: Currently checked-out branch (or HEAD ref).
15
+ commit_hash: Short hash of the current HEAD commit.
16
+ is_valid: Whether all validation checks passed.
17
+ error: Validation error message (empty when valid).
18
+ """
19
+
20
+ path: str
21
+ repo_name: str = ""
22
+ branch: str = ""
23
+ commit_hash: str = ""
24
+ is_valid: bool = False
25
+ error: str = ""
@@ -0,0 +1,18 @@
1
+ """
2
+ Local repository scanner — walks directories, classifies files, and counts LoC.
3
+
4
+ This package runs **entirely on the user's machine**. No source code or file
5
+ contents are ever sent to CodeDD; only the resulting metadata (file paths,
6
+ types, and line counts) is transmitted via the API.
7
+ """
8
+
9
+ from codedd_cli.scanner.file_classifier import get_file_type, should_exclude_file
10
+ from codedd_cli.scanner.file_walker import scan_repository
11
+ from codedd_cli.scanner.line_counter import count_lines
12
+
13
+ __all__ = [
14
+ "get_file_type",
15
+ "should_exclude_file",
16
+ "count_lines",
17
+ "scan_repository",
18
+ ]