GoogleCloudPlatform / pbmm-on-gcp-onboarding
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
rego
mod
gitattributes
tpl
txt
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.

main39346 LOC (75%) 679 files
test2584 LOC (4%) 26 files
generated694 LOC (1%) 1 file
build and deployment1921 LOC (3%) 20 files
other7602 LOC (14%) 61 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
rego
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 679 files match defined criteria (39,346 LOC, 100.0% vs. main code):
    • 416 *.tf files (26,856 LOC)
    • 132 *.yaml files (7,614 LOC)
    • 111 *.tfvars files (2,361 LOC)
    • 13 *.go files (1,989 LOC)
    • 3 *.py files (326 LOC)
    • 1 *.js files (108 LOC)
    • 2 *.rego files (71 LOC)
    • 1 *.tpl files (21 LOC)
  • " *.tf" is biggest, containing 68.26% of LOC.
  • " *.tpl" is smallest, containing 0.05% of LOC.


*.tf26856 LOC (68%) 416 files
*.yaml7614 LOC (19%) 132 files
*.tfvars2361 LOC (6%) 111 files
*.go1989 LOC (5%) 13 files
*.py326 LOC (<1%) 3 files
*.js108 LOC (<1%) 1 file
*.rego71 LOC (<1%) 2 files
*.tpl21 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
rego
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
  • 26 files match defined criteria (2,584 LOC, 6.6% vs. main code):
    • 18 *.go files (2,115 LOC)
    • 4 *.tf files (251 LOC)
    • 3 *.sh files (174 LOC)
    • 1 *.rego files (44 LOC)
  • " *.go" is biggest, containing 81.85% of LOC.
  • " *.rego" is smallest, containing 1.7% of LOC.


*.go2115 LOC (81%) 18 files
*.tf251 LOC (9%) 4 files
*.sh174 LOC (6%) 3 files
*.rego44 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".
  • 1 file matches defined criteria (694 LOC, 1.8% vs. main code). All matches are in *.json files.


*.json694 LOC (100%) 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 ".*/[.]gitattributes".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 20 files match defined criteria (1,921 LOC, 4.9% vs. main code). All matches are in *.sh files.


*.sh1921 LOC (100%) 20 files
Other Code
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/go[.]mod".
  • 61 files match defined criteria (7,602 LOC, 19.3% vs. main code):
    • 57 *.md files (6,746 LOC)
    • 2 *.json files (710 LOC)
    • 2 *.mod files (146 LOC)
  • " *.md" is biggest, containing 88.74% of LOC.
  • " *.mod" is smallest, containing 1.92% of LOC.


*.md6746 LOC (88%) 57 files
*.json710 LOC (9%) 2 files
*.mod146 LOC (1%) 2 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 15:37