anthropics / cwc-workshops
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
mjs
npmrc
editorconfig
  • 18 extensions are included in analyses: ts, tsx, py, md, json, yaml, sh, mjs, gitignore, css, html, txt, toml, js, npmrc, cjs, dockerignore, editorconfig
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (1 file).
    • 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 ".*/bin/.*" (Binaries for distribution) (3 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (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.

main15957 LOC (45%) 199 files
test1042 LOC (2%) 10 files
generated5928 LOC (16%) 3 files
build and deployment885 LOC (2%) 21 files
other11190 LOC (31%) 63 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
mjs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 199 files match defined criteria (15,957 LOC, 100.0% vs. main code):
    • 45 *.py files (4,635 LOC)
    • 54 *.tsx files (4,280 LOC)
    • 66 *.ts files (2,610 LOC)
    • 2 *.js files (1,252 LOC)
    • 5 *.css files (1,233 LOC)
    • 7 *.mjs files (1,178 LOC)
    • 3 *.html files (328 LOC)
    • 13 *.yaml files (241 LOC)
    • 2 *.cjs files (143 LOC)
    • 2 *.toml files (57 LOC)
  • " *.py" is biggest, containing 29.05% of LOC.
  • " *.toml" is smallest, containing 0.36% of LOC.


*.py4635 LOC (29%) 45 files
*.tsx4280 LOC (26%) 54 files
*.ts2610 LOC (16%) 66 files
*.js1252 LOC (7%) 2 files
*.css1233 LOC (7%) 5 files
*.mjs1178 LOC (7%) 7 files
*.html328 LOC (2%) 3 files
*.yaml241 LOC (1%) 13 files
*.cjs143 LOC (<1%) 2 files
*.toml57 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
mjs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/vitest[.].*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
  • 10 files match defined criteria (1,042 LOC, 6.5% vs. main code):
    • 8 *.ts files (673 LOC)
    • 2 *.mjs files (369 LOC)
  • " *.ts" is biggest, containing 64.59% of LOC.
  • " *.mjs" is smallest, containing 35.41% of LOC.


*.ts673 LOC (64%) 8 files
*.mjs369 LOC (35%) 2 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[-]lock[.]json".
  • 3 files match defined criteria (5,928 LOC, 37.1% vs. main code). All matches are in *.json files.


*.json5928 LOC (100%) 3 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
editorconfig
npmrc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/requirements[a-zA-Z0-9._-]*[.]txt".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*[.]npmrc".
    • files with paths like "(.*/)?[.]npmrc".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like "(.*/)?[.]dockerignore".
    • files with paths like ".*/pyproject[.]toml".
    • files with paths like "(.*/)?[.]prettierrc([.].*)?".
    • files with paths like ".*[.]editorconfig".
    • files with paths like "(.*/)?[.]editorconfig".
  • 21 files match defined criteria (885 LOC, 5.5% vs. main code):
    • 8 *.sh files (765 LOC)
    • 8 *.gitignore files (74 LOC)
    • 1 *.toml files (27 LOC)
    • 1 *.editorconfig files (12 LOC)
    • 1 *.dockerignore files (5 LOC)
    • 2 *.npmrc files (2 LOC)
  • " *.sh" is biggest, containing 86.44% of LOC.
  • " *.npmrc" is smallest, containing 0.23% of LOC.


*.sh765 LOC (86%) 8 files
*.gitignore74 LOC (8%) 8 files
*.toml27 LOC (3%) 1 file
*.editorconfig12 LOC (1%) 1 file
*.dockerignore5 LOC (<1%) 1 file
*.npmrc2 LOC (<1%) 2 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
  • 63 files match defined criteria (11,190 LOC, 70.1% vs. main code):
    • 25 *.json files (8,626 LOC)
    • 35 *.md files (2,513 LOC)
    • 3 *.txt files (51 LOC)
  • " *.json" is biggest, containing 77.09% of LOC.
  • " *.txt" is smallest, containing 0.46% of LOC.


*.json8626 LOC (77%) 25 files
*.md2513 LOC (22%) 35 files
*.txt51 LOC (<1%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.tsx 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
  • *.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
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
    • Advanced 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
  • *.cjs files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.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


2026-06-24 10:48