elastic / apm-agent-php
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
txt
phpt
feature
ini
htaccess
patch
gitattributes
editorconfig
in
m4
clang-format
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.

main31197 LOC (30%) 359 files
test53114 LOC (51%) 408 files
generated0 LOC (0%) 0 files
build and deployment668 LOC (<1%) 7 files
other17957 LOC (17%) 237 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 359 files match defined criteria (31,197 LOC, 100.0% vs. main code):
    • 231 *.php files (13,429 LOC)
    • 45 *.cpp files (10,782 LOC)
    • 72 *.h files (5,648 LOC)
    • 6 *.cmake files (1,200 LOC)
    • 2 *.xml files (74 LOC)
    • 2 *.yaml files (50 LOC)
    • 1 *.in files (14 LOC)
  • " *.php" is biggest, containing 43.05% of LOC.
  • " *.in" is smallest, containing 0.04% of LOC.


*.php13429 LOC (43%) 231 files
*.cpp10782 LOC (34%) 45 files
*.h5648 LOC (18%) 72 files
*.cmake1200 LOC (3%) 6 files
*.xml74 LOC (<1%) 2 files
*.yaml50 LOC (<1%) 2 files
*.in14 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
phpt
feature
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.]feature".
    • files with paths like ".*/UnitTests?/.*".
    • files with paths like ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*/tests_.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]tests[-].*".
    • files with paths like ".*/testing[.].*".
    • files with paths like ".*/test[.].*".
  • 408 files match defined criteria (53,114 LOC, 170.3% vs. main code):
    • 339 *.php files (48,833 LOC)
    • 19 *.cpp files (2,666 LOC)
    • 29 *.phpt files (682 LOC)
    • 6 *.feature files (497 LOC)
    • 10 *.sh files (367 LOC)
    • 1 *.xml files (39 LOC)
    • 2 *.h files (17 LOC)
    • 1 *.py files (9 LOC)
    • 1 *.inc files (4 LOC)
  • " *.php" is biggest, containing 91.94% of LOC.
  • " *.inc" is smallest, containing 0.01% of LOC.


*.php48833 LOC (91%) 339 files
*.cpp2666 LOC (5%) 19 files
*.phpt682 LOC (1%) 29 files
*.feature497 LOC (<1%) 6 files
*.sh367 LOC (<1%) 10 files
*.xml39 LOC (<1%) 1 file
*.h17 LOC (<1%) 2 files
*.py9 LOC (<1%) 1 file
*.inc4 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/[.]gitattributes".
  • 7 files match defined criteria (668 LOC, 2.1% vs. main code). All matches are in *.sh files.


*.sh668 LOC (100%) 7 files
Other Code
txt
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/wp[-]includes/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[.]htaccess".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/COPYRIGHT[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
  • 237 files match defined criteria (17,957 LOC, 57.6% vs. main code):
    • 18 *.json files (6,077 LOC)
    • 33 *.txt files (4,936 LOC)
    • 118 *.php files (4,163 LOC)
    • 26 *.md files (1,345 LOC)
    • 19 *.sh files (409 LOC)
    • 8 *.phtml files (407 LOC)
    • 3 *.css files (269 LOC)
    • 4 *.ini files (91 LOC)
    • 1 *.js files (91 LOC)
    • 2 *.xml files (66 LOC)
    • 1 *.svg files (49 LOC)
    • 2 *.sql files (31 LOC)
    • 1 *.bat files (14 LOC)
    • 1 *.html files (9 LOC)
  • " *.json" is biggest, containing 33.84% of LOC.
  • " *.html" is smallest, containing 0.05% of LOC.


*.json6077 LOC (33%) 18 files
*.txt4936 LOC (27%) 33 files
*.php4163 LOC (23%) 118 files
*.md1345 LOC (7%) 26 files
*.sh409 LOC (2%) 19 files
*.phtml407 LOC (2%) 8 files
*.css269 LOC (1%) 3 files
*.ini91 LOC (<1%) 4 files
*.js91 LOC (<1%) 1 file
*.xml66 LOC (<1%) 2 files
*.svg49 LOC (<1%) 1 file
*.sql31 LOC (<1%) 2 files
*.bat14 LOC (<1%) 1 file
*.html9 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:49