GoogleCloudPlatform / java-docs-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
properties
cfg
txt
proto
launch
srt
cmd
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.

main105133 LOC (46%) 2,273 files
test72194 LOC (31%) 922 files
generated0 LOC (0%) 0 files
build and deployment27317 LOC (12%) 366 files
other22103 LOC (9%) 421 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
launch
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2273 files match defined criteria (105,133 LOC, 100.0% vs. main code):
    • 1,978 *.java files (97,461 LOC)
    • 115 *.xml files (1,567 LOC)
    • 29 *.html files (1,473 LOC)
    • 82 *.yaml files (1,230 LOC)
    • 9 *.css files (1,194 LOC)
    • 30 *.jsp files (1,165 LOC)
    • 5 *.js files (297 LOC)
    • 3 *.tf files (213 LOC)
    • 2 *.proto files (154 LOC)
    • 5 *.scala files (153 LOC)
    • 4 *.kt files (59 LOC)
    • 3 *.groovy files (59 LOC)
    • 2 *.sbt files (47 LOC)
    • 3 *.toml files (22 LOC)
    • 1 *.py files (19 LOC)
    • 1 *.launch files (14 LOC)
    • 1 *.sql files (6 LOC)
  • " *.java" is biggest, containing 92.7% of LOC.
  • " *.sql" is smallest, containing 0.01% of LOC.


*.java97461 LOC (92%) 1,978 files
*.xml1567 LOC (1%) 115 files
*.html1473 LOC (1%) 29 files
*.yaml1230 LOC (1%) 82 files
*.css1194 LOC (1%) 9 files
*.jsp1165 LOC (1%) 30 files
*.js297 LOC (<1%) 5 files
*.tf213 LOC (<1%) 3 files
*.proto154 LOC (<1%) 2 files
*.scala153 LOC (<1%) 5 files
*.kt59 LOC (<1%) 4 files
*.groovy59 LOC (<1%) 3 files
*.sbt47 LOC (<1%) 2 files
*.toml22 LOC (<1%) 3 files
*.py19 LOC (<1%) 1 file
*.launch14 LOC (<1%) 1 file
*.sql6 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 ".*/test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_tests[.].*".
  • 922 files match defined criteria (72,194 LOC, 68.7% vs. main code):
    • 915 *.java files (72,023 LOC)
    • 3 *.yaml files (55 LOC)
    • 1 *.scala files (51 LOC)
    • 2 *.kt files (36 LOC)
    • 1 *.sh files (29 LOC)
  • " *.java" is biggest, containing 99.76% of LOC.
  • " *.sh" is smallest, containing 0.04% of LOC.


*.java72023 LOC (99%) 915 files
*.yaml55 LOC (<1%) 3 files
*.scala51 LOC (<1%) 1 file
*.kt36 LOC (<1%) 2 files
*.sh29 LOC (<1%) 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 ".*/pom[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/docker[-]compose[.]yaml".
    • files with paths like ".*/assembly[.]xml".
  • 366 files match defined criteria (27,317 LOC, 26.0% vs. main code):
    • 304 *.xml files (25,362 LOC)
    • 11 *.bat files (748 LOC)
    • 29 *.gradle files (710 LOC)
    • 21 *.sh files (480 LOC)
    • 1 *.yaml files (17 LOC)
  • " *.xml" is biggest, containing 92.84% of LOC.
  • " *.yaml" is smallest, containing 0.06% of LOC.


*.xml25362 LOC (92%) 304 files
*.bat748 LOC (2%) 11 files
*.gradle710 LOC (2%) 29 files
*.sh480 LOC (1%) 21 files
*.yaml17 LOC (<1%) 1 file
Other Code
properties
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 ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ee]xamples/.*".
    • 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 ".*[.]svg".
  • 421 files match defined criteria (22,103 LOC, 21.0% vs. main code):
    • 137 *.java files (11,369 LOC)
    • 202 *.md files (9,268 LOC)
    • 49 *.properties files (810 LOC)
    • 17 *.json files (570 LOC)
    • 1 *.xml files (54 LOC)
    • 11 *.txt files (28 LOC)
    • 4 *.svg files (4 LOC)
  • " *.java" is biggest, containing 51.44% of LOC.
  • " *.svg" is smallest, containing 0.02% of LOC.


*.java11369 LOC (51%) 137 files
*.md9268 LOC (41%) 202 files
*.properties810 LOC (3%) 49 files
*.json570 LOC (2%) 17 files
*.xml54 LOC (<1%) 1 file
*.txt28 LOC (<1%) 11 files
*.svg4 LOC (<1%) 4 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 14:21