codeui-python 0.1.0__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 (52) hide show
  1. codeui/__init__.py +23 -0
  2. codeui/agent/__init__.py +15 -0
  3. codeui/agent/context.py +207 -0
  4. codeui/agent/contribution.py +224 -0
  5. codeui/agent/edit_tools.py +280 -0
  6. codeui/agent/integrations.py +243 -0
  7. codeui/agent/mcp_server.py +94 -0
  8. codeui/analysis/__init__.py +1 -0
  9. codeui/analysis/api_drift.py +79 -0
  10. codeui/analysis/base.py +42 -0
  11. codeui/analysis/circular.py +116 -0
  12. codeui/analysis/dead_code.py +63 -0
  13. codeui/analysis/duplicates.py +69 -0
  14. codeui/analysis/runner.py +57 -0
  15. codeui/analysis/shadowing.py +49 -0
  16. codeui/analysis/undefined.py +97 -0
  17. codeui/analysis/unreachable.py +28 -0
  18. codeui/analysis/unresolved_import.py +153 -0
  19. codeui/cli/__init__.py +1 -0
  20. codeui/cli/main.py +437 -0
  21. codeui/core/__init__.py +1 -0
  22. codeui/core/cache.py +135 -0
  23. codeui/core/graph.py +435 -0
  24. codeui/core/ir.py +218 -0
  25. codeui/core/override.py +230 -0
  26. codeui/core/repo.py +85 -0
  27. codeui/core/resolver.py +281 -0
  28. codeui/errors.py +98 -0
  29. codeui/lang/__init__.py +1 -0
  30. codeui/lang/base.py +117 -0
  31. codeui/lang/generic.py +90 -0
  32. codeui/lang/go.py +167 -0
  33. codeui/lang/python.py +294 -0
  34. codeui/lang/registry.py +83 -0
  35. codeui/lang/rust.py +185 -0
  36. codeui/lang/ts.py +396 -0
  37. codeui/plugins/__init__.py +1 -0
  38. codeui/plugins/registry.py +31 -0
  39. codeui/report/__init__.py +1 -0
  40. codeui/report/json_emitter.py +24 -0
  41. codeui/report/markdown_emitter.py +33 -0
  42. codeui/report/sarif_emitter.py +56 -0
  43. codeui/server/__init__.py +1 -0
  44. codeui/server/server.py +705 -0
  45. codeui/tracer/__init__.py +1 -0
  46. codeui/tracer/tracer.py +147 -0
  47. codeui_python-0.1.0.dist-info/METADATA +191 -0
  48. codeui_python-0.1.0.dist-info/RECORD +52 -0
  49. codeui_python-0.1.0.dist-info/WHEEL +5 -0
  50. codeui_python-0.1.0.dist-info/entry_points.txt +2 -0
  51. codeui_python-0.1.0.dist-info/licenses/LICENSE +21 -0
  52. codeui_python-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,33 @@
1
+ """Markdown defect report emitter."""
2
+ from typing import Any
3
+ from codeui.core.graph import Graph
4
+
5
+ class MarkdownEmitter:
6
+ """Emits human-readable Markdown defect summary reports.
7
+ Example:
8
+ >>> g = Graph()
9
+ >>> emitter = MarkdownEmitter()
10
+ >>> report = emitter.emit(g)
11
+ >>> '# codeui Defect Report' in report
12
+ True
13
+ """
14
+ def emit(self, graph: Graph) -> str:
15
+ """Convert graph findings to formatted Markdown document.
16
+ Example:
17
+ >>> g = Graph()
18
+ >>> emitter = MarkdownEmitter()
19
+ >>> isinstance(emitter.emit(g), str)
20
+ True
21
+ """
22
+ lines = [
23
+ "# codeui Defect Report",
24
+ "",
25
+ f"Total Files Analyzed: {len(graph.get_all_files())}",
26
+ f"Total Defect Findings: {len(graph.get_findings())}",
27
+ "",
28
+ "| Rule ID | Severity | File | Message | Fix Hint |",
29
+ "| --- | --- | --- | --- | --- |",
30
+ ]
31
+ for f in graph.get_findings():
32
+ lines.append(f"| {f.rule_id} | {f.severity} | `{f.location.file_id}:{f.location.start_line}` | {f.message} | {f.fix_hint or '-'} |")
33
+ return "\n".join(lines)
@@ -0,0 +1,56 @@
1
+ """SARIF 2.1.0 format report emitter."""
2
+ import json
3
+ from typing import Any, Dict
4
+ from codeui.core.graph import Graph
5
+
6
+ class SARIFEmitter:
7
+ """Emits OASIS SARIF v2.1.0 standard report format for CI integrations.
8
+ Example:
9
+ >>> g = Graph()
10
+ >>> emitter = SARIFEmitter()
11
+ >>> sarif = emitter.emit(g)
12
+ >>> '$schema' in sarif
13
+ True
14
+ """
15
+ def emit(self, graph: Graph) -> str:
16
+ """Convert graph findings into SARIF v2.1.0 JSON string.
17
+ Example:
18
+ >>> g = Graph()
19
+ >>> emitter = SARIFEmitter()
20
+ >>> isinstance(emitter.emit(g), str)
21
+ True
22
+ """
23
+ results = []
24
+ for f in graph.get_findings():
25
+ level = "error" if str(f.severity) == "error" else ("warning" if str(f.severity) == "warning" else "note")
26
+ results.append({
27
+ "ruleId": f.rule_id,
28
+ "level": level,
29
+ "message": {"text": f.message},
30
+ "locations": [{
31
+ "physicalLocation": {
32
+ "artifactLocation": {"uri": f.location.file_id},
33
+ "region": {
34
+ "startLine": f.location.start_line,
35
+ "startColumn": f.location.start_col + 1,
36
+ "endLine": f.location.end_line,
37
+ "endColumn": f.location.end_col + 1,
38
+ },
39
+ }
40
+ }],
41
+ })
42
+ payload = {
43
+ "$schema": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
44
+ "version": "2.1.0",
45
+ "runs": [{
46
+ "tool": {
47
+ "driver": {
48
+ "name": "codeui",
49
+ "version": "0.1.0",
50
+ "informationUri": "https://codeui.dev",
51
+ }
52
+ },
53
+ "results": results,
54
+ }],
55
+ }
56
+ return json.dumps(payload, sort_keys=True, indent=2)
@@ -0,0 +1 @@
1
+ """Localhost HTTP server package for codeui visualizer and API."""