GoogleCloudPlatform / kubernetes-engine-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
mod
tpl
cshtml
pb
proto
in
csproj
pyi
asax
cfg
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.

main56006 LOC (61%) 1,038 files
test4287 LOC (4%) 16 files
generated2302 LOC (2%) 3 files
build and deployment908 LOC (<1%) 28 files
other28021 LOC (30%) 259 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cshtml
tpl
proto
in
pyi
asax
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1038 files match defined criteria (56,006 LOC, 100.0% vs. main code):
    • 589 *.yaml files (27,933 LOC)
    • 271 *.tf files (14,959 LOC)
    • 68 *.py files (5,207 LOC)
    • 38 *.go files (2,856 LOC)
    • 4 *.ipynb files (1,902 LOC)
    • 6 *.cshtml files (495 LOC)
    • 9 *.html files (482 LOC)
    • 7 *.css files (466 LOC)
    • 3 *.ps1 files (359 LOC)
    • 12 *.cs files (343 LOC)
    • 8 *.js files (292 LOC)
    • 3 *.sql files (227 LOC)
    • 4 *.tpl files (168 LOC)
    • 4 *.proto files (96 LOC)
    • 3 *.in files (43 LOC)
    • 2 *.java files (42 LOC)
    • 1 *.pyi files (38 LOC)
    • 2 *.php files (38 LOC)
    • 1 *.toml files (30 LOC)
    • 1 *.asax files (13 LOC)
    • 1 *.cfg files (10 LOC)
    • 1 *.rb files (7 LOC)
  • " *.yaml" is biggest, containing 49.88% of LOC.
  • " *.rb" is smallest, containing 0.01% of LOC.


*.yaml27933 LOC (49%) 589 files
*.tf14959 LOC (26%) 271 files
*.py5207 LOC (9%) 68 files
*.go2856 LOC (5%) 38 files
*.ipynb1902 LOC (3%) 4 files
*.cshtml495 LOC (<1%) 6 files
*.html482 LOC (<1%) 9 files
*.css466 LOC (<1%) 7 files
*.ps1359 LOC (<1%) 3 files
*.cs343 LOC (<1%) 12 files
*.js292 LOC (<1%) 8 files
*.sql227 LOC (<1%) 3 files
*.tpl168 LOC (<1%) 4 files
*.proto96 LOC (<1%) 4 files
*.in43 LOC (<1%) 3 files
*.java42 LOC (<1%) 2 files
*.pyi38 LOC (<1%) 1 file
*.php38 LOC (<1%) 2 files
*.toml30 LOC (<1%) 1 file
*.asax13 LOC (<1%) 1 file
*.cfg10 LOC (<1%) 1 file
*.rb7 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 ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test[.].*".
  • 16 files match defined criteria (4,287 LOC, 7.7% vs. main code):
    • 10 *.go files (3,242 LOC)
    • 6 *.py files (1,045 LOC)
  • " *.go" is biggest, containing 75.62% of LOC.
  • " *.py" is smallest, containing 24.38% of LOC.


*.go3242 LOC (75%) 10 files
*.py1045 LOC (24%) 6 files
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 ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
    • files with paths like ".*/package[-]lock[.]json".
  • 3 files match defined criteria (2,302 LOC, 4.1% vs. main code):
    • 1 *.json files (2,128 LOC)
    • 2 *.py files (174 LOC)
  • " *.json" is biggest, containing 92.44% of LOC.
  • " *.py" is smallest, containing 7.56% of LOC.


*.json2128 LOC (92%) 1 file
*.py174 LOC (7%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
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 ".*/pom[.]xml".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
  • 28 files match defined criteria (908 LOC, 1.6% vs. main code):
    • 24 *.sh files (597 LOC)
    • 2 *.csproj files (235 LOC)
    • 2 *.xml files (76 LOC)
  • " *.sh" is biggest, containing 65.75% of LOC.
  • " *.xml" is smallest, containing 8.37% of LOC.


*.sh597 LOC (65%) 24 files
*.csproj235 LOC (25%) 2 files
*.xml76 LOC (8%) 2 files
Other Code
pb
txt
mod
tpl
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 ".*/go[.]mod".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]pb".
  • 259 files match defined criteria (28,021 LOC, 50.0% vs. main code):
    • 4 *.pb files (10,252 LOC)
    • 44 *.json files (8,962 LOC)
    • 35 *.txt files (2,661 LOC)
    • 36 *.yaml files (2,541 LOC)
    • 105 *.md files (2,519 LOC)
    • 19 *.tf files (417 LOC)
    • 1 *.ipynb files (300 LOC)
    • 12 *.mod files (272 LOC)
    • 2 *.tpl files (75 LOC)
    • 1 *.properties files (22 LOC)
  • " *.pb" is biggest, containing 36.59% of LOC.
  • " *.properties" is smallest, containing 0.08% of LOC.


*.pb10252 LOC (36%) 4 files
*.json8962 LOC (31%) 44 files
*.txt2661 LOC (9%) 35 files
*.yaml2541 LOC (9%) 36 files
*.md2519 LOC (8%) 105 files
*.tf417 LOC (1%) 19 files
*.ipynb300 LOC (1%) 1 file
*.mod272 LOC (<1%) 12 files
*.tpl75 LOC (<1%) 2 files
*.properties22 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 14:24