GoogleCloudPlatform / ruby-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
ru
txt
jbuilder
slim
cfg
sass
coffee
gitattributes
proto
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.

main21169 LOC (84%) 991 files
test1312 LOC (5%) 52 files
generated27 LOC (<1%) 2 files
build and deployment79 LOC (<1%) 5 files
other2455 LOC (9%) 95 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
slim
ru
coffee
proto
jbuilder
sass
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 991 files match defined criteria (21,169 LOC, 100.0% vs. main code):
    • 685 *.rb files (15,355 LOC)
    • 52 *.html files (2,793 LOC)
    • 60 *.erb files (1,154 LOC)
    • 70 *.yaml files (972 LOC)
    • 12 *.scss files (300 LOC)
    • 10 *.slim files (235 LOC)
    • 40 *.js files (146 LOC)
    • 21 *.ru files (75 LOC)
    • 3 *.coffee files (45 LOC)
    • 19 *.css files (43 LOC)
    • 1 *.proto files (28 LOC)
    • 15 *.jbuilder files (20 LOC)
    • 3 *.sass files (3 LOC)
  • " *.rb" is biggest, containing 72.54% of LOC.
  • " *.sass" is smallest, containing 0.01% of LOC.


*.rb15355 LOC (72%) 685 files
*.html2793 LOC (13%) 52 files
*.erb1154 LOC (5%) 60 files
*.yaml972 LOC (4%) 70 files
*.scss300 LOC (1%) 12 files
*.slim235 LOC (1%) 10 files
*.js146 LOC (<1%) 40 files
*.ru75 LOC (<1%) 21 files
*.coffee45 LOC (<1%) 3 files
*.css43 LOC (<1%) 19 files
*.proto28 LOC (<1%) 1 file
*.jbuilder20 LOC (<1%) 15 files
*.sass3 LOC (<1%) 3 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 ".*/test[.].*".
    • 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 ".*_tests[.].*".
  • 52 files match defined criteria (1,312 LOC, 6.2% vs. main code). All matches are in *.rb files.


*.rb1312 LOC (100%) 52 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[!].*".
  • 2 files match defined criteria (27 LOC, 0.1% vs. main code). All matches are in *.rb files.


*.rb27 LOC (100%) 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/[.]gitattributes".
  • 5 files match defined criteria (79 LOC, 0.4% vs. main code):
    • 4 *.sh files (60 LOC)
    • 1 *.js files (19 LOC)
  • " *.sh" is biggest, containing 75.95% of LOC.
  • " *.js" is smallest, containing 24.05% of LOC.


*.sh60 LOC (75%) 4 files
*.js19 LOC (24%) 1 file
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • 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 ".*/[.]dockerignore".
  • 95 files match defined criteria (2,455 LOC, 11.6% vs. main code):
    • 68 *.md files (2,359 LOC)
    • 8 *.json files (53 LOC)
    • 19 *.txt files (43 LOC)
  • " *.md" is biggest, containing 96.09% of LOC.
  • " *.txt" is smallest, containing 1.75% of LOC.


*.md2359 LOC (96%) 68 files
*.json53 LOC (2%) 8 files
*.txt43 LOC (1%) 19 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 14:23