GoogleCloudPlatform / anthos-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
tml
tpl
mod
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.

main16773 LOC (41%) 250 files
test3773 LOC (9%) 37 files
generated0 LOC (0%) 0 files
build and deployment2472 LOC (6%) 31 files
other17545 LOC (43%) 92 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
tpl
tml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 250 files match defined criteria (16,773 LOC, 100.0% vs. main code):
    • 114 *.yaml files (8,215 LOC)
    • 116 *.tf files (7,932 LOC)
    • 6 *.tpl files (266 LOC)
    • 1 *.py files (224 LOC)
    • 10 *.tml files (55 LOC)
    • 1 *.go files (42 LOC)
    • 2 *.tfvars files (39 LOC)
  • " *.yaml" is biggest, containing 48.98% of LOC.
  • " *.tfvars" is smallest, containing 0.23% of LOC.


*.yaml8215 LOC (48%) 114 files
*.tf7932 LOC (47%) 116 files
*.tpl266 LOC (1%) 6 files
*.py224 LOC (1%) 1 file
*.tml55 LOC (<1%) 10 files
*.go42 LOC (<1%) 1 file
*.tfvars39 LOC (<1%) 2 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 ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test[.].*".
  • 37 files match defined criteria (3,773 LOC, 22.5% vs. main code):
    • 21 *.go files (3,341 LOC)
    • 13 *.tf files (367 LOC)
    • 1 *.rb files (55 LOC)
    • 2 *.yaml files (10 LOC)
  • " *.go" is biggest, containing 88.55% of LOC.
  • " *.yaml" is smallest, containing 0.27% of LOC.


*.go3341 LOC (88%) 21 files
*.tf367 LOC (9%) 13 files
*.rb55 LOC (1%) 1 file
*.yaml10 LOC (<1%) 2 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 31 files match defined criteria (2,472 LOC, 14.7% vs. main code). All matches are in *.sh files.


*.sh2472 LOC (100%) 31 files
Other Code
mod
txt
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 ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/go[.]mod".
  • 92 files match defined criteria (17,545 LOC, 104.6% vs. main code):
    • 28 *.json files (14,265 LOC)
    • 59 *.md files (2,953 LOC)
    • 3 *.mod files (317 LOC)
    • 2 *.txt files (10 LOC)
  • " *.json" is biggest, containing 81.31% of LOC.
  • " *.txt" is smallest, containing 0.06% of LOC.


*.json14265 LOC (81%) 28 files
*.md2953 LOC (16%) 59 files
*.mod317 LOC (1%) 3 files
*.txt10 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 15:28