GoogleCloudPlatform / python-docs-samples
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
txt
in
cfg
mo
ini
proto
po
jinja2
pb
jsonl
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.

main102844 LOC (57%) 2,788 files
test43799 LOC (24%) 1,009 files
generated0 LOC (0%) 0 files
build and deployment561 LOC (<1%) 22 files
other30798 LOC (17%) 1,226 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
in
jinja2
mo
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2788 files match defined criteria (102,844 LOC, 100.0% vs. main code):
    • 2,467 *.py files (87,270 LOC)
    • 12 *.ipynb files (7,574 LOC)
    • 189 *.yaml files (2,692 LOC)
    • 40 *.html files (1,693 LOC)
    • 2 *.sql files (1,263 LOC)
    • 5 *.proto files (956 LOC)
    • 39 *.in files (883 LOC)
    • 12 *.js files (290 LOC)
    • 4 *.toml files (70 LOC)
    • 4 *.jinja2 files (62 LOC)
    • 5 *.mo files (60 LOC)
    • 9 *.css files (31 LOC)
  • " *.py" is biggest, containing 84.86% of LOC.
  • " *.css" is smallest, containing 0.03% of LOC.


*.py87270 LOC (84%) 2,467 files
*.ipynb7574 LOC (7%) 12 files
*.yaml2692 LOC (2%) 189 files
*.html1693 LOC (1%) 40 files
*.sql1263 LOC (1%) 2 files
*.proto956 LOC (<1%) 5 files
*.in883 LOC (<1%) 39 files
*.js290 LOC (<1%) 12 files
*.toml70 LOC (<1%) 4 files
*.jinja262 LOC (<1%) 4 files
*.mo60 LOC (<1%) 5 files
*.css31 LOC (<1%) 9 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
jsonl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]test[-].*".
  • 1009 files match defined criteria (43,799 LOC, 42.6% vs. main code):
    • 1,000 *.py files (43,442 LOC)
    • 8 *.yaml files (352 LOC)
    • 1 *.jsonl files (5 LOC)
  • " *.py" is biggest, containing 99.18% of LOC.
  • " *.jsonl" is smallest, containing 0.01% of LOC.


*.py43442 LOC (99%) 1,000 files
*.yaml352 LOC (<1%) 8 files
*.jsonl5 LOC (<1%) 1 file
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 ".*[.]sh".
    • files with paths like ".*/docker[-]compose[.]yaml".
  • 22 files match defined criteria (561 LOC, 0.5% vs. main code):
    • 21 *.sh files (544 LOC)
    • 1 *.yaml files (17 LOC)
  • " *.sh" is biggest, containing 96.97% of LOC.
  • " *.yaml" is smallest, containing 3.03% of LOC.


*.sh544 LOC (96%) 21 files
*.yaml17 LOC (3%) 1 file
Other Code
txt
pb
in
po
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]po".
    • files with paths like ".*[.]pb".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Dd]emos?/.*".
  • 1226 files match defined criteria (30,798 LOC, 29.9% vs. main code):
    • 261 *.md files (9,499 LOC)
    • 786 *.txt files (5,879 LOC)
    • 3 *.pb files (5,673 LOC)
    • 57 *.rst files (4,249 LOC)
    • 62 *.py files (2,630 LOC)
    • 34 *.json files (1,740 LOC)
    • 1 *.ipynb files (823 LOC)
    • 6 *.in files (107 LOC)
    • 5 *.po files (87 LOC)
    • 2 *.html files (66 LOC)
    • 5 *.ini files (41 LOC)
    • 4 *.svg files (4 LOC)
  • " *.md" is biggest, containing 30.84% of LOC.
  • " *.svg" is smallest, containing 0.01% of LOC.


*.md9499 LOC (30%) 261 files
*.txt5879 LOC (19%) 786 files
*.pb5673 LOC (18%) 3 files
*.rst4249 LOC (13%) 57 files
*.py2630 LOC (8%) 62 files
*.json1740 LOC (5%) 34 files
*.ipynb823 LOC (2%) 1 file
*.in107 LOC (<1%) 6 files
*.po87 LOC (<1%) 5 files
*.html66 LOC (<1%) 2 files
*.ini41 LOC (<1%) 5 files
*.svg4 LOC (<1%) 4 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 14:22