hhvm / user-documentation
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
ini
dockerignore
patch
hhi
tpl
  • 18 extensions are included in analyses: md, hack, php, txt, scss, json, sh, tf, yml, ini, gitignore, dockerfile, js, dockerignore, patch, xml, hhi, tpl
  • 2 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (7 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (14 files).
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.

main21590 LOC (47%) 761 files
test1423 LOC (3%) 21 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other22648 LOC (49%) 689 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
hhi
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 761 files match defined criteria (21,590 lines of code, 100.0% vs. main code):
    • 582 *.hack files (10,414 lines of code)
    • 156 *.php files (9,606 lines of code)
    • 20 *.scss files (1,537 lines of code)
    • 1 *.js files (19 lines of code)
    • 1 *.xml files (7 lines of code)
    • 1 *.hhi files (7 lines of code)
  • " *.hack" is biggest, containing 48.24% of code.
  • " *.hhi" is smallest, containing 0.03% of code.


*.hack10414 LOC (48%) 582 files
*.php9606 LOC (44%) 156 files
*.scss1537 LOC (7%) 20 files
*.js19 LOC (<1%) 1 files
*.xml7 LOC (<1%) 1 files
*.hhi7 LOC (<1%) 1 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]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
  • 21 files match defined criteria (1,423 lines of code, 6.6% vs. main code):
    • 19 *.php files (1,407 lines of code)
    • 2 *.hack files (16 lines of code)
  • " *.php" is biggest, containing 98.88% of code.
  • " *.hack" is smallest, containing 1.12% of code.


*.php1407 LOC (98%) 19 files
*.hack16 LOC (1%) 2 files
Other Code
txt
patch
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
  • 689 files match defined criteria (22,648 lines of code, 104.9% vs. main code):
    • 622 *.md files (22,352 lines of code)
    • 4 *.json files (116 lines of code)
    • 55 *.txt files (59 lines of code)
    • 5 *.hack files (52 lines of code)
    • 1 *.patch files (40 lines of code)
    • 2 *.ini files (29 lines of code)
  • " *.md" is biggest, containing 98.69% of code.
  • " *.ini" is smallest, containing 0.13% of code.


*.md22352 LOC (98%) 622 files
*.json116 LOC (<1%) 4 files
*.txt59 LOC (<1%) 55 files
*.hack52 LOC (<1%) 5 files
*.patch40 LOC (<1%) 1 files
*.ini29 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.hack files are analyzed with HackAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.php files are analyzed with PhpAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Basic heuristic dependency analysis
  • *.scss files are analyzed with ScssAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.js files are analyzed with JavaScriptAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.xml files are analyzed with XmlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.hhi files are analyzed with HtmlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis


2022-04-16 06:59