GoogleCloudPlatform / solution-acceleration-toolkit
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
hcl
rego
mod
gitattributes
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.

main9210 LOC (23%) 107 files
test2421 LOC (6%) 12 files
generated12459 LOC (31%) 239 files
build and deployment244 LOC (<1%) 18 files
other15350 LOC (38%) 270 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
hcl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 107 files match defined criteria (9,210 LOC, 100.0% vs. main code):
    • 35 *.go files (3,248 LOC)
    • 10 *.hcl files (3,189 LOC)
    • 37 *.tf files (2,220 LOC)
    • 20 *.yaml files (424 LOC)
    • 5 *.tfvars files (129 LOC)
  • " *.go" is biggest, containing 35.27% of LOC.
  • " *.tfvars" is smallest, containing 1.4% of LOC.


*.go3248 LOC (35%) 35 files
*.hcl3189 LOC (34%) 10 files
*.tf2220 LOC (24%) 37 files
*.yaml424 LOC (4%) 20 files
*.tfvars129 LOC (1%) 5 files
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 ".*/[Tt]ests/.*".
    • files with paths like ".*/test[.].*".
  • 12 files match defined criteria (2,421 LOC, 26.3% vs. main code):
    • 11 *.go files (2,401 LOC)
    • 1 *.sh files (20 LOC)
  • " *.go" is biggest, containing 99.17% of LOC.
  • " *.sh" is smallest, containing 0.83% of LOC.


*.go2401 LOC (99%) 11 files
*.sh20 LOC (<1%) 1 file
Generated Code
Automatically generated files, not manually changed after generation.
rego
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/generated/.*".
  • 239 files match defined criteria (12,459 LOC, 135.3% vs. main code):
    • 138 *.yaml files (6,328 LOC)
    • 58 *.tf files (4,327 LOC)
    • 12 *.md files (932 LOC)
    • 15 *.sh files (450 LOC)
    • 12 *.tfvars files (303 LOC)
    • 3 *.rego files (115 LOC)
    • 1 *.json files (4 LOC)
  • " *.yaml" is biggest, containing 50.79% of LOC.
  • " *.json" is smallest, containing 0.03% of LOC.


*.yaml6328 LOC (50%) 138 files
*.tf4327 LOC (34%) 58 files
*.md932 LOC (7%) 12 files
*.sh450 LOC (3%) 15 files
*.tfvars303 LOC (2%) 12 files
*.rego115 LOC (<1%) 3 files
*.json4 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 ".*/[.]gitattributes".
  • 18 files match defined criteria (244 LOC, 2.6% vs. main code). All matches are in *.sh files.


*.sh244 LOC (100%) 18 files
Other Code
hcl
rego
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/go[.]mod".
  • 270 files match defined criteria (15,350 LOC, 166.7% vs. main code):
    • 139 *.yaml files (6,335 LOC)
    • 58 *.tf files (4,327 LOC)
    • 13 *.hcl files (2,078 LOC)
    • 22 *.md files (1,369 LOC)
    • 15 *.sh files (450 LOC)
    • 1 *.tfstate files (310 LOC)
    • 12 *.tfvars files (303 LOC)
    • 3 *.rego files (115 LOC)
    • 6 *.json files (39 LOC)
    • 1 *.mod files (24 LOC)
  • " *.yaml" is biggest, containing 41.27% of LOC.
  • " *.mod" is smallest, containing 0.16% of LOC.


*.yaml6335 LOC (41%) 139 files
*.tf4327 LOC (28%) 58 files
*.hcl2078 LOC (13%) 13 files
*.md1369 LOC (8%) 22 files
*.sh450 LOC (2%) 15 files
*.tfstate310 LOC (2%) 1 file
*.tfvars303 LOC (1%) 12 files
*.rego115 LOC (<1%) 3 files
*.json39 LOC (<1%) 6 files
*.mod24 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 15:17