GoogleCloudPlatform / terraform-google-enterprise-genai
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
txt
gitmodules
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.

main26068 LOC (55%) 447 files
test2592 LOC (5%) 26 files
generated856 LOC (1%) 1 file
build and deployment617 LOC (1%) 6 files
other17224 LOC (36%) 115 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
rego
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 447 files match defined criteria (26,068 LOC, 100.0% vs. main code):
    • 294 *.tf files (17,879 LOC)
    • 118 *.yaml files (5,506 LOC)
    • 13 *.go files (2,010 LOC)
    • 18 *.tfvars files (442 LOC)
    • 1 *.js files (108 LOC)
    • 2 *.rego files (71 LOC)
    • 1 *.py files (52 LOC)
  • " *.tf" is biggest, containing 68.59% of LOC.
  • " *.py" is smallest, containing 0.2% of LOC.


*.tf17879 LOC (68%) 294 files
*.yaml5506 LOC (21%) 118 files
*.go2010 LOC (7%) 13 files
*.tfvars442 LOC (1%) 18 files
*.js108 LOC (<1%) 1 file
*.rego71 LOC (<1%) 2 files
*.py52 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,592 LOC, 9.9% vs. main code):
    • 18 *.go files (2,095 LOC)
    • 4 *.tf files (253 LOC)
    • 3 *.sh files (200 LOC)
    • 1 *.rego files (44 LOC)
  • " *.go" is biggest, containing 80.83% of LOC.
  • " *.rego" is smallest, containing 1.7% of LOC.


*.go2095 LOC (80%) 18 files
*.tf253 LOC (9%) 4 files
*.sh200 LOC (7%) 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 (856 LOC, 3.3% vs. main code). All matches are in *.json files.


*.json856 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 ".*/[.]gitmodules".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 6 files match defined criteria (617 LOC, 2.4% vs. main code). All matches are in *.sh files.


*.sh617 LOC (100%) 6 files
Other Code
mod
txt
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 ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/go[.]mod".
  • 115 files match defined criteria (17,224 LOC, 66.1% vs. main code):
    • 53 *.md files (7,421 LOC)
    • 2 *.ipynb files (2,678 LOC)
    • 8 *.yaml files (2,316 LOC)
    • 31 *.tf files (2,080 LOC)
    • 11 *.py files (1,651 LOC)
    • 4 *.json files (896 LOC)
    • 2 *.mod files (136 LOC)
    • 2 *.tfvars files (25 LOC)
    • 1 *.txt files (20 LOC)
    • 1 *.sql files (1 LOC)
  • " *.md" is biggest, containing 43.09% of LOC.
  • " *.sql" is smallest, containing 0.01% of LOC.


*.md7421 LOC (43%) 53 files
*.ipynb2678 LOC (15%) 2 files
*.yaml2316 LOC (13%) 8 files
*.tf2080 LOC (12%) 31 files
*.py1651 LOC (9%) 11 files
*.json896 LOC (5%) 4 files
*.mod136 LOC (<1%) 2 files
*.tfvars25 LOC (<1%) 2 files
*.txt20 LOC (<1%) 1 file
*.sql1 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 16:04