GoogleCloudPlatform / cloud-builders-community
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
mod
hcl
rmd
boot
nix
rego
proto
pub
properties
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.

main3733 LOC (23%) 170 files
test145 LOC (<1%) 2 files
generated2556 LOC (16%) 1 file
build and deployment282 LOC (1%) 10 files
other9063 LOC (57%) 329 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
nix
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 170 files match defined criteria (3,733 LOC, 100.0% vs. main code):
    • 121 *.yaml files (1,702 LOC)
    • 17 *.go files (1,387 LOC)
    • 20 *.bash files (346 LOC)
    • 1 *.py files (97 LOC)
    • 6 *.ps1 files (87 LOC)
    • 1 *.ts files (67 LOC)
    • 3 *.toml files (35 LOC)
    • 1 *.nix files (12 LOC)
  • " *.yaml" is biggest, containing 45.59% of LOC.
  • " *.nix" is smallest, containing 0.32% of LOC.


*.yaml1702 LOC (45%) 121 files
*.go1387 LOC (37%) 17 files
*.bash346 LOC (9%) 20 files
*.py97 LOC (2%) 1 file
*.ps187 LOC (2%) 6 files
*.ts67 LOC (1%) 1 file
*.toml35 LOC (<1%) 3 files
*.nix12 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 ".*/[Tt]est/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/test[.].*".
  • 2 files match defined criteria (145 LOC, 3.9% vs. main code):
    • 1 *.go files (129 LOC)
    • 1 *.yaml files (16 LOC)
  • " *.go" is biggest, containing 88.97% of LOC.
  • " *.yaml" is smallest, containing 11.03% of LOC.


*.go129 LOC (88%) 1 file
*.yaml16 LOC (11%) 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 (2,556 LOC, 68.5% vs. main code). All matches are in *.json files.


*.json2556 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/docker[-]compose[.]yaml".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/pom[.]xml".
  • 10 files match defined criteria (282 LOC, 7.6% vs. main code):
    • 9 *.sh files (281 LOC)
    • 1 *.bat files (1 LOC)
  • " *.sh" is biggest, containing 99.65% of LOC.
  • " *.bat" is smallest, containing 0.35% of LOC.


*.sh281 LOC (99%) 9 files
*.bat1 LOC (<1%) 1 file
Other Code
hcl
mod
proto
rego
txt
boot
pub
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]markdown".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]json".
  • 329 files match defined criteria (9,063 LOC, 242.8% vs. main code):
    • 141 *.md files (3,357 LOC)
    • 6 *.json files (2,648 LOC)
    • 102 *.yaml files (1,819 LOC)
    • 8 *.markdown files (350 LOC)
    • 8 *.sh files (247 LOC)
    • 10 *.tf files (179 LOC)
    • 11 *.py files (69 LOC)
    • 2 *.xml files (63 LOC)
    • 8 *.js files (60 LOC)
    • 2 *.scala files (40 LOC)
    • 4 *.tfvars files (36 LOC)
    • 2 *.hcl files (33 LOC)
    • 2 *.go files (31 LOC)
    • 4 *.mod files (26 LOC)
    • 2 *.html files (26 LOC)
    • 1 *.rb files (20 LOC)
    • 1 *.proto files (10 LOC)
    • 3 *.sbt files (9 LOC)
    • 1 *.java files (8 LOC)
    • 1 *.jsonnet files (8 LOC)
    • 1 *.pp files (7 LOC)
    • 1 *.rego files (6 LOC)
    • 5 *.txt files (5 LOC)
    • 1 *.boot files (4 LOC)
    • 1 *.pub files (1 LOC)
    • 1 *.properties files (1 LOC)
  • " *.md" is biggest, containing 37.04% of LOC.
  • " *.properties" is smallest, containing 0.01% of LOC.


*.md3357 LOC (37%) 141 files
*.json2648 LOC (29%) 6 files
*.yaml1819 LOC (20%) 102 files
*.markdown350 LOC (3%) 8 files
*.sh247 LOC (2%) 8 files
*.tf179 LOC (1%) 10 files
*.py69 LOC (<1%) 11 files
*.xml63 LOC (<1%) 2 files
*.js60 LOC (<1%) 8 files
*.scala40 LOC (<1%) 2 files
*.tfvars36 LOC (<1%) 4 files
*.hcl33 LOC (<1%) 2 files
*.go31 LOC (<1%) 2 files
*.mod26 LOC (<1%) 4 files
*.html26 LOC (<1%) 2 files
*.rb20 LOC (<1%) 1 file
*.proto10 LOC (<1%) 1 file
*.sbt9 LOC (<1%) 3 files
*.java8 LOC (<1%) 1 file
*.jsonnet8 LOC (<1%) 1 file
*.pp7 LOC (<1%) 1 file
*.rego6 LOC (<1%) 1 file
*.txt5 LOC (<1%) 5 files
*.boot4 LOC (<1%) 1 file
*.pub1 LOC (<1%) 1 file
*.properties1 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 14:31