openai / openai-cookbook
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
pkl
jsonl
mdx
mjs
tex
prettierignore
  • 24 extensions are included in analyses: ipynb, json, py, md, txt, js, pkl, tsx, svg, ts, yaml, gitignore, html, jsonl, css, mdx, mjs, scss, jsx, toml, tex, dockerignore, sh, prettierignore
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (8 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (9 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (0 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (3 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).
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.

main7716 LOC (2%) 8 files
test0 LOC (0%) 0 files
generated4903 LOC (1%) 2 files
build and deployment176 LOC (<1%) 4 files
other252296 LOC (95%) 860 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 8 files match defined criteria (7,716 LOC, 100.0% vs. main code):
    • 5 *.ipynb files (3,960 LOC)
    • 2 *.yaml files (3,717 LOC)
    • 1 *.py files (39 LOC)
  • " *.ipynb" is biggest, containing 51.32% of LOC.
  • " *.py" is smallest, containing 0.51% of LOC.


*.ipynb3960 LOC (51%) 5 files
*.yaml3717 LOC (48%) 2 files
*.py39 LOC (<1%) 1 file
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".
  • 2 files match defined criteria (4,903 LOC, 63.5% vs. main code). All matches are in *.json files.


*.json4903 LOC (100%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*/docker[-]compose[.]yaml".
    • files with paths like ".*/requirements[a-zA-Z0-9._-]*[.]txt".
    • files with paths like "(.*/)?[.](idea|vscode|vs|gradle|mvn|settings|metadata|circleci)/.*".
    • files with paths like ".*/pyproject[.]toml".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/pnpm.*[.]ya?ml".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like "(.*/)?[.]prettierignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like "(.*/)?[.]dockerignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]github/workflows/.*[.]ya?ml".
  • 4 files match defined criteria (176 LOC, 2.3% vs. main code):
    • 1 *.gitignore files (128 LOC)
    • 3 *.yaml files (48 LOC)
  • " *.gitignore" is biggest, containing 72.73% of LOC.
  • " *.yaml" is smallest, containing 27.27% of LOC.


*.gitignore128 LOC (72%) 1 file
*.yaml48 LOC (27%) 3 files
Other Code
pkl
jsonl
mdx
mjs
prettierignore
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]mdx".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]svg".
  • 860 files match defined criteria (252,296 LOC, 3269.8% vs. main code):
    • 155 *.ipynb files (121,673 LOC)
    • 33 *.pkl files (28,092 LOC)
    • 191 *.py files (23,914 LOC)
    • 159 *.json files (19,171 LOC)
    • 5 *.jsonl files (10,537 LOC)
    • 81 *.txt files (10,498 LOC)
    • 86 *.md files (10,202 LOC)
    • 8 *.css files (5,231 LOC)
    • 6 *.yaml files (4,179 LOC)
    • 43 *.js files (4,072 LOC)
    • 22 *.tsx files (3,355 LOC)
    • 13 *.svg files (2,885 LOC)
    • 11 *.html files (2,801 LOC)
    • 4 *.jsx files (2,695 LOC)
    • 5 *.mdx files (1,223 LOC)
    • 9 *.ts files (705 LOC)
    • 5 *.mjs files (384 LOC)
    • 4 *.scss files (302 LOC)
    • 14 *.gitignore files (212 LOC)
    • 3 *.toml files (116 LOC)
    • 1 *.sh files (36 LOC)
    • 1 *.prettierignore files (7 LOC)
    • 1 *.dockerignore files (6 LOC)
  • " *.ipynb" is biggest, containing 48.23% of LOC.
  • " *.dockerignore" is smallest, containing 0% of LOC.


*.ipynb121673 LOC (48%) 155 files
*.pkl28092 LOC (11%) 33 files
*.py23914 LOC (9%) 191 files
*.json19171 LOC (7%) 159 files
*.jsonl10537 LOC (4%) 5 files
*.txt10498 LOC (4%) 81 files
*.md10202 LOC (4%) 86 files
*.css5231 LOC (2%) 8 files
*.yaml4179 LOC (1%) 6 files
*.js4072 LOC (1%) 43 files
*.tsx3355 LOC (1%) 22 files
*.svg2885 LOC (1%) 13 files
*.html2801 LOC (1%) 11 files
*.jsx2695 LOC (1%) 4 files
*.mdx1223 LOC (<1%) 5 files
*.ts705 LOC (<1%) 9 files
*.mjs384 LOC (<1%) 5 files
*.scss302 LOC (<1%) 4 files
*.gitignore212 LOC (<1%) 14 files
*.toml116 LOC (<1%) 3 files
*.sh36 LOC (<1%) 1 file
*.prettierignore7 LOC (<1%) 1 file
*.dockerignore6 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
  • *.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
  • *.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


2026-06-24 10:33