GoogleCloudPlatform / risk-and-research-blueprints
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
proto
mod
in
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.

main5799 LOC (27%) 114 files
test1195 LOC (5%) 12 files
generated0 LOC (0%) 0 files
build and deployment74 LOC (<1%) 2 files
other14036 LOC (66%) 133 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 114 files match defined criteria (5,799 LOC, 100.0% vs. main code):
    • 69 *.yaml files (3,932 LOC)
    • 43 *.tf files (1,735 LOC)
    • 1 *.py files (131 LOC)
    • 1 *.in files (1 LOC)
  • " *.yaml" is biggest, containing 67.8% of LOC.
  • " *.in" is smallest, containing 0.02% of LOC.


*.yaml3932 LOC (67%) 69 files
*.tf1735 LOC (29%) 43 files
*.py131 LOC (2%) 1 file
*.in1 LOC (<1%) 1 file
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 ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[-]test[-].*".
  • 12 files match defined criteria (1,195 LOC, 20.6% vs. main code). All matches are in *.yaml files.


*.yaml1195 LOC (100%) 12 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 2 files match defined criteria (74 LOC, 1.3% vs. main code). All matches are in *.sh files.


*.sh74 LOC (100%) 2 files
Other Code
txt
proto
mod
in
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 ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[.]dockerignore".
  • 133 files match defined criteria (14,036 LOC, 242.0% vs. main code):
    • 27 *.go files (3,040 LOC)
    • 33 *.tf files (2,892 LOC)
    • 4 *.json files (2,812 LOC)
    • 29 *.md files (2,365 LOC)
    • 6 *.py files (867 LOC)
    • 6 *.txt files (795 LOC)
    • 9 *.yaml files (418 LOC)
    • 7 *.proto files (298 LOC)
    • 5 *.sql files (211 LOC)
    • 1 *.ipynb files (151 LOC)
    • 2 *.mod files (125 LOC)
    • 2 *.sh files (31 LOC)
    • 1 *.in files (18 LOC)
    • 1 *.toml files (13 LOC)
  • " *.go" is biggest, containing 21.66% of LOC.
  • " *.toml" is smallest, containing 0.09% of LOC.


*.go3040 LOC (21%) 27 files
*.tf2892 LOC (20%) 33 files
*.json2812 LOC (20%) 4 files
*.md2365 LOC (16%) 29 files
*.py867 LOC (6%) 6 files
*.txt795 LOC (5%) 6 files
*.yaml418 LOC (2%) 9 files
*.proto298 LOC (2%) 7 files
*.sql211 LOC (1%) 5 files
*.ipynb151 LOC (1%) 1 file
*.mod125 LOC (<1%) 2 files
*.sh31 LOC (<1%) 2 files
*.in18 LOC (<1%) 1 file
*.toml13 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 16:07