GoogleCloudPlatform / php-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
ini
cfg
txt
m4
proto
htaccess
pb
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.

main39814 LOC (56%) 1,323 files
test23726 LOC (33%) 247 files
generated212 LOC (<1%) 6 files
build and deployment241 LOC (<1%) 3 files
other5864 LOC (8%) 260 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1323 files match defined criteria (39,814 LOC, 100.0% vs. main code):
    • 1,247 *.php files (38,315 LOC)
    • 49 *.yaml files (595 LOC)
    • 13 *.twig files (589 LOC)
    • 2 *.html files (89 LOC)
    • 3 *.js files (79 LOC)
    • 2 *.c files (48 LOC)
    • 2 *.proto files (35 LOC)
    • 1 *.xml files (26 LOC)
    • 1 *.avsc files (18 LOC)
    • 1 *.css files (14 LOC)
    • 2 *.h files (6 LOC)
  • " *.php" is biggest, containing 96.23% of LOC.
  • " *.h" is smallest, containing 0.02% of LOC.


*.php38315 LOC (96%) 1,247 files
*.yaml595 LOC (1%) 49 files
*.twig589 LOC (1%) 13 files
*.html89 LOC (<1%) 2 files
*.js79 LOC (<1%) 3 files
*.c48 LOC (<1%) 2 files
*.proto35 LOC (<1%) 2 files
*.xml26 LOC (<1%) 1 file
*.avsc18 LOC (<1%) 1 file
*.css14 LOC (<1%) 1 file
*.h6 LOC (<1%) 2 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 ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*/[Mm]ocks/.*".
  • 247 files match defined criteria (23,726 LOC, 59.6% vs. main code):
    • 246 *.php files (23,723 LOC)
    • 1 *.sql files (3 LOC)
  • " *.php" is biggest, containing 99.99% of LOC.
  • " *.sql" is smallest, containing 0.01% of LOC.


*.php23723 LOC (99%) 246 files
*.sql3 LOC (<1%) 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 ".*/generated/.*".
    • 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[!].*".
  • 6 files match defined criteria (212 LOC, 0.5% vs. main code). All matches are in *.php files.


*.php212 LOC (100%) 6 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
  • 3 files match defined criteria (241 LOC, 0.6% vs. main code). All matches are in *.sh files.


*.sh241 LOC (100%) 3 files
Other Code
ini
txt
pb
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 ".*[.]pb".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[.]htaccess".
  • 260 files match defined criteria (5,864 LOC, 14.7% vs. main code):
    • 123 *.md files (4,631 LOC)
    • 120 *.json files (1,176 LOC)
    • 10 *.ini files (30 LOC)
    • 6 *.txt files (14 LOC)
    • 1 *.pb files (13 LOC)
  • " *.md" is biggest, containing 78.97% of LOC.
  • " *.pb" is smallest, containing 0.22% of LOC.


*.md4631 LOC (78%) 123 files
*.json1176 LOC (20%) 120 files
*.ini30 LOC (<1%) 10 files
*.txt14 LOC (<1%) 6 files
*.pb13 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-04 14:19