GoogleCloudPlatform / ops-agent
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
lua
mod
gitattributes
spec
mak
txt
proto
gitmodules
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.

main28124 LOC (57%) 192 files
test6244 LOC (12%) 30 files
generated11757 LOC (24%) 14 files
build and deployment468 LOC (<1%) 17 files
other2238 LOC (4%) 21 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
spec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 192 files match defined criteria (28,124 LOC, 100.0% vs. main code):
    • 107 *.go files (18,340 LOC)
    • 78 *.yaml files (9,220 LOC)
    • 4 *.ps1 files (206 LOC)
    • 1 *.py files (185 LOC)
    • 1 *.proto files (103 LOC)
    • 1 *.spec files (70 LOC)
  • " *.go" is biggest, containing 65.21% of LOC.
  • " *.spec" is smallest, containing 0.25% of LOC.


*.go18340 LOC (65%) 107 files
*.yaml9220 LOC (32%) 78 files
*.ps1206 LOC (<1%) 4 files
*.py185 LOC (<1%) 1 file
*.proto103 LOC (<1%) 1 file
*.spec70 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 ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
  • 30 files match defined criteria (6,244 LOC, 22.2% vs. main code):
    • 25 *.go files (6,061 LOC)
    • 2 *.sh files (153 LOC)
    • 1 *.yaml files (17 LOC)
    • 2 *.bash files (13 LOC)
  • " *.go" is biggest, containing 97.07% of LOC.
  • " *.bash" is smallest, containing 0.21% of LOC.


*.go6061 LOC (97%) 25 files
*.sh153 LOC (2%) 2 files
*.yaml17 LOC (<1%) 1 file
*.bash13 LOC (<1%) 2 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 ".*/generated/.*".
  • 14 files match defined criteria (11,757 LOC, 41.8% vs. main code). All matches are in *.go files.


*.go11757 LOC (100%) 14 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mak
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]mak".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/[.]gitattributes".
  • 17 files match defined criteria (468 LOC, 1.7% vs. main code):
    • 15 *.sh files (304 LOC)
    • 1 *.mak files (158 LOC)
    • 1 *.bat files (6 LOC)
  • " *.sh" is biggest, containing 64.96% of LOC.
  • " *.bat" is smallest, containing 1.28% of LOC.


*.sh304 LOC (64%) 15 files
*.mak158 LOC (33%) 1 file
*.bat6 LOC (1%) 1 file
Other Code
mod
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 ".*/[.]gitignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[.]dockerignore".
  • 21 files match defined criteria (2,238 LOC, 8.0% vs. main code):
    • 20 *.md files (2,048 LOC)
    • 1 *.mod files (190 LOC)
  • " *.md" is biggest, containing 91.51% of LOC.
  • " *.mod" is smallest, containing 8.49% of LOC.


*.md2048 LOC (91%) 20 files
*.mod190 LOC (8%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 15:29