GoogleCloudPlatform / cloud-code-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
cshtml
txt
mod
cfg
csproj
properties
hbs
eslintignore
gitattributes
tpl
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.

main7700 LOC (24%) 249 files
test452 LOC (1%) 14 files
generated10282 LOC (32%) 6 files
build and deployment404 LOC (1%) 10 files
other12481 LOC (39%) 80 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cshtml
hbs
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 249 files match defined criteria (7,700 LOC, 100.0% vs. main code):
    • 73 *.yaml files (1,654 LOC)
    • 13 *.css files (1,382 LOC)
    • 12 *.html files (1,143 LOC)
    • 29 *.java files (877 LOC)
    • 20 *.cs files (550 LOC)
    • 43 *.py files (484 LOC)
    • 7 *.go files (388 LOC)
    • 19 *.tf files (277 LOC)
    • 10 *.js files (274 LOC)
    • 14 *.cshtml files (255 LOC)
    • 2 *.hbs files (231 LOC)
    • 2 *.kts files (74 LOC)
    • 1 *.tpl files (61 LOC)
    • 3 *.pug files (42 LOC)
    • 1 *.xml files (8 LOC)
  • " *.yaml" is biggest, containing 21.48% of LOC.
  • " *.xml" is smallest, containing 0.1% of LOC.


*.yaml1654 LOC (21%) 73 files
*.css1382 LOC (17%) 13 files
*.html1143 LOC (14%) 12 files
*.java877 LOC (11%) 29 files
*.cs550 LOC (7%) 20 files
*.py484 LOC (6%) 43 files
*.go388 LOC (5%) 7 files
*.tf277 LOC (3%) 19 files
*.js274 LOC (3%) 10 files
*.cshtml255 LOC (3%) 14 files
*.hbs231 LOC (3%) 2 files
*.kts74 LOC (<1%) 2 files
*.tpl61 LOC (<1%) 1 file
*.pug42 LOC (<1%) 3 files
*.xml8 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]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test[.].*".
  • 14 files match defined criteria (452 LOC, 5.9% vs. main code):
    • 6 *.java files (233 LOC)
    • 5 *.sh files (140 LOC)
    • 1 *.go files (43 LOC)
    • 1 *.js files (19 LOC)
    • 1 *.py files (17 LOC)
  • " *.java" is biggest, containing 51.55% of LOC.
  • " *.py" is smallest, containing 3.76% of LOC.


*.java233 LOC (51%) 6 files
*.sh140 LOC (30%) 5 files
*.go43 LOC (9%) 1 file
*.js19 LOC (4%) 1 file
*.py17 LOC (3%) 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".
  • 6 files match defined criteria (10,282 LOC, 133.5% vs. main code). All matches are in *.json files.


*.json10282 LOC (100%) 6 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 ".*/pom[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]csproj".
  • 10 files match defined criteria (404 LOC, 5.2% vs. main code):
    • 6 *.xml files (375 LOC)
    • 4 *.csproj files (29 LOC)
  • " *.xml" is biggest, containing 92.82% of LOC.
  • " *.csproj" is smallest, containing 7.18% of LOC.


*.xml375 LOC (92%) 6 files
*.csproj29 LOC (7%) 4 files
Other Code
txt
mod
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*/checkstyle.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 80 files match defined criteria (12,481 LOC, 162.1% vs. main code):
    • 17 *.json files (10,459 LOC)
    • 39 *.md files (1,649 LOC)
    • 4 *.xml files (276 LOC)
    • 11 *.txt files (62 LOC)
    • 5 *.mod files (31 LOC)
    • 4 *.properties files (4 LOC)
  • " *.json" is biggest, containing 83.8% of LOC.
  • " *.properties" is smallest, containing 0.03% of LOC.


*.json10459 LOC (83%) 17 files
*.md1649 LOC (13%) 39 files
*.xml276 LOC (2%) 4 files
*.txt62 LOC (<1%) 11 files
*.mod31 LOC (<1%) 5 files
*.properties4 LOC (<1%) 4 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 14:44