anthropics / claude-cookbooks
Source Code Overview

Analysis scope, overview of main, test, generated, deployment, build, and other code.

Source Code Analysis Scope
Files includes and excluded from analyses
jsonl
npmrc
pkl
ini
mjs
  • 18 extensions are included in analyses: py, md, ipynb, json, txt, yaml, ts, gitignore, sh, toml, jsonl, npmrc, pkl, dockerignore, xml, c, ini, mjs
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (12 files).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (0 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (2 files).
Overview of Analyzed Files
Basic stats on analyzed files
Intro
For analysis purposes we separate files in scope into several categories: main, test, generated, deployment and build, and other.

  • The main category contains all manually created source code files that are being used in the production.
  • Files in the main category are used as input for other analyses: logical decomposition, concerns, duplication, file size, unit size, and conditional complexity.
  • Test source code files are used only for testing of the product. These files are normally not deployed to production.
  • Build and deployment source code files are used to configure or support build and deployment process.
  • Generated source code files are automatically generated files that have not been manually changed after generation.
  • While a source code folder may contain a number of files, we are primarily interested in the source code files that are being written and maintained by developers.
  • Files containing binaries, documentation, or third-party libraries, for instance, are excluded from analysis. The exception are third-party libraries that have been changed by developers.

main43691 LOC (81%) 177 files
test1593 LOC (2%) 20 files
generated0 LOC (0%) 0 files
build and deployment686 LOC (1%) 33 files
other7636 LOC (14%) 136 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pkl
mjs
jsonl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 177 files match defined criteria (43,691 LOC, 100.0% vs. main code):
    • 42 *.ipynb files (28,514 LOC)
    • 88 *.py files (11,868 LOC)
    • 17 *.yaml files (1,658 LOC)
    • 20 *.ts files (1,258 LOC)
    • 1 *.pkl files (139 LOC)
    • 4 *.toml files (93 LOC)
    • 1 *.mjs files (56 LOC)
    • 1 *.c files (39 LOC)
    • 1 *.xml files (34 LOC)
    • 2 *.jsonl files (32 LOC)
  • " *.ipynb" is biggest, containing 65.26% of LOC.
  • " *.jsonl" is smallest, containing 0.07% of LOC.


*.ipynb28514 LOC (65%) 42 files
*.py11868 LOC (27%) 88 files
*.yaml1658 LOC (3%) 17 files
*.ts1258 LOC (2%) 20 files
*.pkl139 LOC (<1%) 1 file
*.toml93 LOC (<1%) 4 files
*.mjs56 LOC (<1%) 1 file
*.c39 LOC (<1%) 1 file
*.xml34 LOC (<1%) 1 file
*.jsonl32 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
  • 20 files match defined criteria (1,593 LOC, 3.6% vs. main code):
    • 19 *.py files (1,223 LOC)
    • 1 *.ipynb files (370 LOC)
  • " *.py" is biggest, containing 76.77% of LOC.
  • " *.ipynb" is smallest, containing 23.23% of LOC.


*.py1223 LOC (76%) 19 files
*.ipynb370 LOC (23%) 1 file
Build and Deployment Code
Source code used to configure or support build and deployment process.
npmrc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/requirements[a-zA-Z0-9._-]*[.]txt".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/Dockerfile[.][a-zA-Z0-9._-]+".
    • files with paths like ".*/pyproject[.]toml".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]npmrc".
    • files with paths like "(.*/)?[.]npmrc".
  • 33 files match defined criteria (686 LOC, 1.6% vs. main code):
    • 9 *.sh files (299 LOC)
    • 16 *.gitignore files (244 LOC)
    • 4 *.toml files (126 LOC)
    • 1 *.dockerignore files (14 LOC)
    • 3 *.npmrc files (3 LOC)
  • " *.sh" is biggest, containing 43.59% of LOC.
  • " *.npmrc" is smallest, containing 0.44% of LOC.


*.sh299 LOC (43%) 9 files
*.gitignore244 LOC (35%) 16 files
*.toml126 LOC (18%) 4 files
*.dockerignore14 LOC (2%) 1 file
*.npmrc3 LOC (<1%) 3 files
Other Code
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]ini".
  • 136 files match defined criteria (7,636 LOC, 17.5% vs. main code):
    • 79 *.md files (4,532 LOC)
    • 30 *.json files (1,825 LOC)
    • 25 *.txt files (749 LOC)
    • 1 *.py files (386 LOC)
    • 1 *.ini files (144 LOC)
  • " *.md" is biggest, containing 59.35% of LOC.
  • " *.ini" is smallest, containing 1.89% of LOC.


*.md4532 LOC (59%) 79 files
*.json1825 LOC (23%) 30 files
*.txt749 LOC (9%) 25 files
*.py386 LOC (5%) 1 file
*.ini144 LOC (1%) 1 file
Analyzers
Info about analyzers used for source code examinations.
  • *.ipynb files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.py files are analyzed with PythonAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Basic heuristic dependency analysis
  • *.yaml files are analyzed with YamlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.pkl files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.toml files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.mjs files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.c files are analyzed with CStyleAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.xml files are analyzed with XmlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.jsonl files are analyzed with JsonAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis


2026-06-24 10:44