codecaliper 0.1.0__tar.gz
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.
- codecaliper-0.1.0/.editorconfig +31 -0
- codecaliper-0.1.0/.gitattributes +12 -0
- codecaliper-0.1.0/.gitignore +41 -0
- codecaliper-0.1.0/.mailmap +3 -0
- codecaliper-0.1.0/ARCHITECTURE.md +661 -0
- codecaliper-0.1.0/CHANGELOG.md +170 -0
- codecaliper-0.1.0/CITATION.cff +47 -0
- codecaliper-0.1.0/CODE_OF_CONDUCT.md +56 -0
- codecaliper-0.1.0/CONTRIBUTING.md +60 -0
- codecaliper-0.1.0/LICENSE +21 -0
- codecaliper-0.1.0/NOTICE +29 -0
- codecaliper-0.1.0/PKG-INFO +180 -0
- codecaliper-0.1.0/README.md +134 -0
- codecaliper-0.1.0/RELEASING.md +100 -0
- codecaliper-0.1.0/SECURITY.md +22 -0
- codecaliper-0.1.0/constraints/build.txt +13 -0
- codecaliper-0.1.0/constraints/ci.txt +18 -0
- codecaliper-0.1.0/constraints/docs.txt +40 -0
- codecaliper-0.1.0/constraints/retrain.txt +14 -0
- codecaliper-0.1.0/docs/api.md +63 -0
- codecaliper-0.1.0/docs/contributing.md +8 -0
- codecaliper-0.1.0/docs/honesty.md +108 -0
- codecaliper-0.1.0/docs/index.md +67 -0
- codecaliper-0.1.0/docs/quickstart.md +134 -0
- codecaliper-0.1.0/docs/spec/divergences.md +52 -0
- codecaliper-0.1.0/docs/spec/rulings.md +711 -0
- codecaliper-0.1.0/docs/validation.md +30 -0
- codecaliper-0.1.0/mkdocs.yml +76 -0
- codecaliper-0.1.0/notes.md +153 -0
- codecaliper-0.1.0/pyproject.toml +112 -0
- codecaliper-0.1.0/src/codecaliper/__init__.py +64 -0
- codecaliper-0.1.0/src/codecaliper/_version.py +1 -0
- codecaliper-0.1.0/src/codecaliper/api.py +446 -0
- codecaliper-0.1.0/src/codecaliper/canonical.py +130 -0
- codecaliper-0.1.0/src/codecaliper/cli.py +231 -0
- codecaliper-0.1.0/src/codecaliper/errors.py +27 -0
- codecaliper-0.1.0/src/codecaliper/languages/__init__.py +44 -0
- codecaliper-0.1.0/src/codecaliper/languages/base.py +162 -0
- codecaliper-0.1.0/src/codecaliper/languages/java.py +192 -0
- codecaliper-0.1.0/src/codecaliper/languages/python.py +179 -0
- codecaliper-0.1.0/src/codecaliper/metrics/__init__.py +0 -0
- codecaliper-0.1.0/src/codecaliper/metrics/base.py +55 -0
- codecaliper-0.1.0/src/codecaliper/metrics/cognitive.py +111 -0
- codecaliper-0.1.0/src/codecaliper/metrics/cyclomatic.py +62 -0
- codecaliper-0.1.0/src/codecaliper/metrics/halstead.py +55 -0
- codecaliper-0.1.0/src/codecaliper/metrics/loc.py +62 -0
- codecaliper-0.1.0/src/codecaliper/metrics/mi.py +31 -0
- codecaliper-0.1.0/src/codecaliper/model.py +132 -0
- codecaliper-0.1.0/src/codecaliper/py.typed +0 -0
- codecaliper-0.1.0/src/codecaliper/readability/__init__.py +13 -0
- codecaliper-0.1.0/src/codecaliper/readability/base.py +11 -0
- codecaliper-0.1.0/src/codecaliper/readability/bw2010.py +156 -0
- codecaliper-0.1.0/src/codecaliper/readability/granularity.py +210 -0
- codecaliper-0.1.0/src/codecaliper/readability/retrain.py +67 -0
- codecaliper-0.1.0/src/codecaliper/spec/__init__.py +3 -0
- codecaliper-0.1.0/src/codecaliper/spec/registry.py +112 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/bw.toml +156 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/cognitive.toml +124 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/core.toml +87 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/cyclomatic.toml +172 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/halstead.toml +20 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/index.toml +54 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/loc.toml +50 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/mi.toml +15 -0
- codecaliper-0.1.0/src/codecaliper/spec/rulings/tokenization.toml +191 -0
- codecaliper-0.1.0/src/codecaliper/spec/validated_grammars.toml +6 -0
- codecaliper-0.1.0/src/codecaliper/syntax/__init__.py +0 -0
- codecaliper-0.1.0/src/codecaliper/syntax/_treesitter.py +179 -0
- codecaliper-0.1.0/src/codecaliper/syntax/grammars.py +45 -0
- codecaliper-0.1.0/src/codecaliper/syntax/tokens.py +165 -0
- codecaliper-0.1.0/tests/_reference/__init__.py +0 -0
- codecaliper-0.1.0/tests/_reference/bw_stdlib.py +158 -0
- codecaliper-0.1.0/tests/_reference/py_ast_lane.py +161 -0
- codecaliper-0.1.0/tests/conftest.py +85 -0
- codecaliper-0.1.0/tests/corpus/java/java-block-comment-001/expected.toml +28 -0
- codecaliper-0.1.0/tests/corpus/java/java-block-comment-001/input.java +6 -0
- codecaliper-0.1.0/tests/corpus/java/java-boolop-catch-001/expected.toml +33 -0
- codecaliper-0.1.0/tests/corpus/java/java-boolop-catch-001/input.java +12 -0
- codecaliper-0.1.0/tests/corpus/java/java-contextual-001/expected.toml +45 -0
- codecaliper-0.1.0/tests/corpus/java/java-contextual-001/input.java +10 -0
- codecaliper-0.1.0/tests/corpus/java/java-elseif-001/expected.toml +36 -0
- codecaliper-0.1.0/tests/corpus/java/java-elseif-001/input.java +11 -0
- codecaliper-0.1.0/tests/corpus/java/java-labeled-jump-001/expected.toml +40 -0
- codecaliper-0.1.0/tests/corpus/java/java-labeled-jump-001/input.java +15 -0
- codecaliper-0.1.0/tests/corpus/java/java-loops-001/expected.toml +55 -0
- codecaliper-0.1.0/tests/corpus/java/java-loops-001/input.java +17 -0
- codecaliper-0.1.0/tests/corpus/java/java-snippet-constructor-001/expected.toml +107 -0
- codecaliper-0.1.0/tests/corpus/java/java-snippet-constructor-001/input.java +6 -0
- codecaliper-0.1.0/tests/corpus/java/java-switch-001/expected.toml +36 -0
- codecaliper-0.1.0/tests/corpus/java/java-switch-001/input.java +14 -0
- codecaliper-0.1.0/tests/corpus/java/java-ternary-001/expected.toml +35 -0
- codecaliper-0.1.0/tests/corpus/java/java-ternary-001/input.java +7 -0
- codecaliper-0.1.0/tests/corpus/java/java-underscore-001/expected.toml +44 -0
- codecaliper-0.1.0/tests/corpus/java/java-underscore-001/input.java +6 -0
- codecaliper-0.1.0/tests/corpus/python/py-blank-lines-001/expected.toml +32 -0
- codecaliper-0.1.0/tests/corpus/python/py-blank-lines-001/input.py +4 -0
- codecaliper-0.1.0/tests/corpus/python/py-bw-fallback-001/expected.toml +81 -0
- codecaliper-0.1.0/tests/corpus/python/py-bw-fallback-001/input.py +5 -0
- codecaliper-0.1.0/tests/corpus/python/py-cc-boolop-001/expected.toml +84 -0
- codecaliper-0.1.0/tests/corpus/python/py-cc-boolop-001/input.py +5 -0
- codecaliper-0.1.0/tests/corpus/python/py-comprehension-001/expected.toml +34 -0
- codecaliper-0.1.0/tests/corpus/python/py-comprehension-001/input.py +2 -0
- codecaliper-0.1.0/tests/corpus/python/py-concat-string-001/expected.toml +46 -0
- codecaliper-0.1.0/tests/corpus/python/py-concat-string-001/input.py +5 -0
- codecaliper-0.1.0/tests/corpus/python/py-elif-chain-001/expected.toml +40 -0
- codecaliper-0.1.0/tests/corpus/python/py-elif-chain-001/input.py +9 -0
- codecaliper-0.1.0/tests/corpus/python/py-ellipsis-001/expected.toml +74 -0
- codecaliper-0.1.0/tests/corpus/python/py-ellipsis-001/input.py +4 -0
- codecaliper-0.1.0/tests/corpus/python/py-error-opacity-001/expected.toml +40 -0
- codecaliper-0.1.0/tests/corpus/python/py-error-opacity-001/input.py +6 -0
- codecaliper-0.1.0/tests/corpus/python/py-future-import-001/expected.toml +51 -0
- codecaliper-0.1.0/tests/corpus/python/py-future-import-001/input.py +7 -0
- codecaliper-0.1.0/tests/corpus/python/py-match-001/expected.toml +45 -0
- codecaliper-0.1.0/tests/corpus/python/py-match-001/input.py +17 -0
- codecaliper-0.1.0/tests/corpus/python/py-multiline-string-001/expected.toml +33 -0
- codecaliper-0.1.0/tests/corpus/python/py-multiline-string-001/input.py +4 -0
- codecaliper-0.1.0/tests/corpus/python/py-nested-function-001/expected.toml +34 -0
- codecaliper-0.1.0/tests/corpus/python/py-nested-function-001/input.py +10 -0
- codecaliper-0.1.0/tests/corpus/python/py-recursion-001/expected.toml +28 -0
- codecaliper-0.1.0/tests/corpus/python/py-recursion-001/input.py +4 -0
- codecaliper-0.1.0/tests/corpus/python/py-ternary-001/expected.toml +43 -0
- codecaliper-0.1.0/tests/corpus/python/py-ternary-001/input.py +4 -0
- codecaliper-0.1.0/tests/corpus/python/py-tok-normalize-001/expected.toml +105 -0
- codecaliper-0.1.0/tests/corpus/python/py-tok-normalize-001/input.py +4 -0
- codecaliper-0.1.0/tests/corpus/python/py-try-except-001/expected.toml +119 -0
- codecaliper-0.1.0/tests/corpus/python/py-try-except-001/input.py +7 -0
- codecaliper-0.1.0/tests/differential/__init__.py +9 -0
- codecaliper-0.1.0/tests/differential/_harness.py +382 -0
- codecaliper-0.1.0/tests/differential/divergences.toml +143 -0
- codecaliper-0.1.0/tests/differential/test_cognitive.py +30 -0
- codecaliper-0.1.0/tests/differential/test_lizard.py +29 -0
- codecaliper-0.1.0/tests/differential/test_radon.py +28 -0
- codecaliper-0.1.0/tests/differential/test_table.py +45 -0
- codecaliper-0.1.0/tests/snapshots/corpus_values.json +1200 -0
- codecaliper-0.1.0/tests/test_bw_port_fidelity.py +72 -0
- codecaliper-0.1.0/tests/test_cli.py +156 -0
- codecaliper-0.1.0/tests/test_consistency_corpus.py +152 -0
- codecaliper-0.1.0/tests/test_determinism.py +37 -0
- codecaliper-0.1.0/tests/test_grammar_integrity.py +63 -0
- codecaliper-0.1.0/tests/test_measure_behavior.py +480 -0
- codecaliper-0.1.0/tests/test_perf_smoke.py +41 -0
- codecaliper-0.1.0/tests/test_python_lane_crosscheck.py +96 -0
- codecaliper-0.1.0/tests/test_spec_coverage.py +106 -0
- codecaliper-0.1.0/tests/test_spec_drift.py +65 -0
- codecaliper-0.1.0/tests/tools_snapshot.py +52 -0
- codecaliper-0.1.0/tools/gen_divergences.py +101 -0
- codecaliper-0.1.0/tools/gen_spec_docs.py +51 -0
- codecaliper-0.1.0/tools/update_snapshot.py +94 -0
- codecaliper-0.1.0/validation/bw_faithfulness/README.md +101 -0
- codecaliper-0.1.0/validation/bw_faithfulness/arbitrate.py +831 -0
- codecaliper-0.1.0/validation/bw_faithfulness/dataset.toml +27 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/arbitration_inputs/extract_meta_fallback_on_tab1.json +46 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/arbitration_inputs/features_fallback_on_tab1.csv +101 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/arbitration_inputs/train_results_fallback_off.json +251 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/arbitration_report.json +1183 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/arbitration_report.md +105 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/bw_faithfulness_report.json +270 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/bw_faithfulness_report.md +69 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/extract_meta.json +45 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/features.csv +101 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/features_fallback_off.csv +101 -0
- codecaliper-0.1.0/validation/bw_faithfulness/derived/train_results.json +255 -0
- codecaliper-0.1.0/validation/bw_faithfulness/extract.py +171 -0
- codecaliper-0.1.0/validation/bw_faithfulness/fetch.py +54 -0
- codecaliper-0.1.0/validation/bw_faithfulness/fig9_signs.toml +155 -0
- codecaliper-0.1.0/validation/bw_faithfulness/report.py +194 -0
- codecaliper-0.1.0/validation/bw_faithfulness/stats.py +59 -0
- codecaliper-0.1.0/validation/bw_faithfulness/train.py +267 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# EditorConfig (https://editorconfig.org) — keeps non-Python files consistent;
|
|
2
|
+
# Python style is enforced by ruff (line-length 100, see pyproject.toml).
|
|
3
|
+
root = true
|
|
4
|
+
|
|
5
|
+
[*]
|
|
6
|
+
charset = utf-8
|
|
7
|
+
end_of_line = lf
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
indent_style = space
|
|
11
|
+
|
|
12
|
+
[*.py]
|
|
13
|
+
indent_size = 4
|
|
14
|
+
max_line_length = 100
|
|
15
|
+
|
|
16
|
+
[*.{toml,yml,yaml}]
|
|
17
|
+
indent_size = 2
|
|
18
|
+
|
|
19
|
+
[*.md]
|
|
20
|
+
# Markdown uses trailing double-space as a hard line break.
|
|
21
|
+
trim_trailing_whitespace = false
|
|
22
|
+
|
|
23
|
+
# Corpus fixtures are measurement inputs with hand-computed expected values —
|
|
24
|
+
# trailing whitespace and missing final newlines can be the very thing a case
|
|
25
|
+
# measures (e.g. py-blank-lines-001). Editors must never "clean" them; a silent
|
|
26
|
+
# fix here surfaces later as a baffling spec-drift gate failure.
|
|
27
|
+
[tests/corpus/**]
|
|
28
|
+
trim_trailing_whitespace = false
|
|
29
|
+
insert_final_newline = false
|
|
30
|
+
indent_style = unset
|
|
31
|
+
indent_size = unset
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Normalize everything to LF in the repository and on checkout — the
|
|
2
|
+
# reproducibility claim (byte-identical outputs per platform) dies if git
|
|
3
|
+
# rewrites source line endings differently per contributor.
|
|
4
|
+
* text=auto eol=lf
|
|
5
|
+
|
|
6
|
+
# Corpus fixtures are MEASUREMENT INPUTS with hand-computed expected values:
|
|
7
|
+
# their exact bytes (line endings, trailing whitespace, BOMs for future TOK-*
|
|
8
|
+
# cases) are load-bearing. Never convert them.
|
|
9
|
+
tests/corpus/** -text
|
|
10
|
+
|
|
11
|
+
# Reference dataset snapshots, if any ever land, are exact bytes too.
|
|
12
|
+
tests/snapshots/** -text
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
.venv/
|
|
8
|
+
venv/
|
|
9
|
+
.python-version
|
|
10
|
+
.mypy_cache/
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.hypothesis/
|
|
14
|
+
.tox/
|
|
15
|
+
.nox/
|
|
16
|
+
.coverage
|
|
17
|
+
.coverage.*
|
|
18
|
+
coverage.xml
|
|
19
|
+
htmlcov/
|
|
20
|
+
|
|
21
|
+
# BW faithfulness dataset cache — the license-UNVERIFIED data is NEVER committed
|
|
22
|
+
# (ARCHITECTURE.md §8.3). cache/ holds the fetched archive and anything extracted
|
|
23
|
+
# from it; the committable extractor outputs live in the TRACKED sibling
|
|
24
|
+
# validation/bw_faithfulness/derived/ — do not add ignore rules for derived/.
|
|
25
|
+
validation/bw_faithfulness/cache/
|
|
26
|
+
validation/bw_faithfulness/*.zip
|
|
27
|
+
|
|
28
|
+
# mkdocs build output (deployed by .github/workflows/docs.yml, never committed)
|
|
29
|
+
site/
|
|
30
|
+
|
|
31
|
+
# MSR paper sources — submission material, kept local until publication
|
|
32
|
+
# (pyproject.toml excludes it from the sdist and release.yml asserts that,
|
|
33
|
+
# as defense in depth should this rule ever be dropped)
|
|
34
|
+
paper/
|
|
35
|
+
|
|
36
|
+
# Editors / OS
|
|
37
|
+
.idea/
|
|
38
|
+
.vscode/
|
|
39
|
+
*.swp
|
|
40
|
+
*~
|
|
41
|
+
.DS_Store
|