GoogleCloudPlatform / cloud-build-samples
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
properties
mod
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.

main1206 LOC (7%) 44 files
test483 LOC (2%) 22 files
generated7117 LOC (42%) 4 files
build and deployment444 LOC (2%) 9 files
other7442 LOC (44%) 44 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 44 files match defined criteria (1,206 LOC, 100.0% vs. main code):
    • 3 *.tf files (405 LOC)
    • 24 *.yaml files (402 LOC)
    • 6 *.py files (172 LOC)
    • 3 *.html files (94 LOC)
    • 3 *.go files (59 LOC)
    • 3 *.js files (30 LOC)
    • 1 *.toml files (24 LOC)
    • 1 *.tfvars files (20 LOC)
  • " *.tf" is biggest, containing 33.58% of LOC.
  • " *.tfvars" is smallest, containing 1.66% of LOC.


*.tf405 LOC (33%) 3 files
*.yaml402 LOC (33%) 24 files
*.py172 LOC (14%) 6 files
*.html94 LOC (7%) 3 files
*.go59 LOC (4%) 3 files
*.js30 LOC (2%) 3 files
*.toml24 LOC (1%) 1 file
*.tfvars20 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[.].*".
  • 22 files match defined criteria (483 LOC, 40.0% vs. main code):
    • 11 *.yaml files (264 LOC)
    • 4 *.py files (76 LOC)
    • 3 *.java files (60 LOC)
    • 3 *.js files (48 LOC)
    • 1 *.go files (35 LOC)
  • " *.yaml" is biggest, containing 54.66% of LOC.
  • " *.go" is smallest, containing 7.25% of LOC.


*.yaml264 LOC (54%) 11 files
*.py76 LOC (15%) 4 files
*.java60 LOC (12%) 3 files
*.js48 LOC (9%) 3 files
*.go35 LOC (7%) 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".
  • 4 files match defined criteria (7,117 LOC, 590.1% vs. main code). All matches are in *.json files.


*.json7117 LOC (100%) 4 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 ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 9 files match defined criteria (444 LOC, 36.8% vs. main code):
    • 5 *.sh files (320 LOC)
    • 2 *.xml files (103 LOC)
    • 2 *.gradle files (21 LOC)
  • " *.sh" is biggest, containing 72.07% of LOC.
  • " *.gradle" is smallest, containing 4.73% of LOC.


*.sh320 LOC (72%) 5 files
*.xml103 LOC (23%) 2 files
*.gradle21 LOC (4%) 2 files
Other Code
txt
properties
mod
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 ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[.]gitignore".
  • 44 files match defined criteria (7,442 LOC, 617.1% vs. main code):
    • 10 *.json files (7,244 LOC)
    • 26 *.md files (162 LOC)
    • 3 *.txt files (26 LOC)
    • 3 *.properties files (6 LOC)
    • 2 *.mod files (4 LOC)
  • " *.json" is biggest, containing 97.34% of LOC.
  • " *.mod" is smallest, containing 0.05% of LOC.


*.json7244 LOC (97%) 10 files
*.md162 LOC (2%) 26 files
*.txt26 LOC (<1%) 3 files
*.properties6 LOC (<1%) 3 files
*.mod4 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 15:35