microsoft / php-sdk-binary-tools
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
awk
ini
m4
xsl
txt
gitattributes
tpl
mysql
cmd
  • 20 extensions are included in analyses: php, awk, ini, bat, m4, json, xsl, cc, c, txt, hh, d, gitignore, gitattributes, tpl, java, md, mysql, cmd, yaml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (2 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (14 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (13 files).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (0 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.

main11306 LOC (26%) 77 files
test0 LOC (0%) 0 files
generated0 LOC (0%) 0 files
build and deployment74 LOC (<1%) 7 files
other31793 LOC (73%) 34 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xsl
awk
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 77 files match defined criteria (11,306 lines of code, 100.0% vs. main code):
    • 3 *.c files (3,451 lines of code)
    • 37 *.php files (3,312 lines of code)
    • 3 *.cc files (1,261 lines of code)
    • 4 *.xsl files (926 lines of code)
    • 24 *.awk files (665 lines of code)
    • 1 *.java files (628 lines of code)
    • 1 *.d files (546 lines of code)
    • 2 *.hh files (468 lines of code)
    • 1 *.yaml files (28 lines of code)
    • 1 *.tpl files (21 lines of code)
  • " *.c" is biggest, containing 30.52% of code.
  • " *.tpl" is smallest, containing 0.19% of code.


*.c3451 LOC (30%) 3 files
*.php3312 LOC (29%) 37 files
*.cc1261 LOC (11%) 3 files
*.xsl926 LOC (8%) 4 files
*.awk665 LOC (5%) 24 files
*.java628 LOC (5%) 1 files
*.d546 LOC (4%) 1 files
*.hh468 LOC (4%) 2 files
*.yaml28 LOC (<1%) 1 files
*.tpl21 LOC (<1%) 1 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
  • 7 files match defined criteria (74 lines of code, 0.7% vs. main code). All matches are in *.bat files.


*.bat74 LOC (100%) 7 files
Other Code
ini
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
  • 34 files match defined criteria (31,793 lines of code, 281.2% vs. main code):
    • 20 *.ini files (31,474 lines of code)
    • 1 *.md files (149 lines of code)
    • 11 *.json files (91 lines of code)
    • 2 *.txt files (79 lines of code)
  • " *.ini" is biggest, containing 99% of code.
  • " *.txt" is smallest, containing 0.25% of code.


*.ini31474 LOC (98%) 20 files
*.md149 LOC (<1%) 1 files
*.json91 LOC (<1%) 11 files
*.txt79 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.cc files are analyzed with CppAnalyzer:
    • 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
  • *.xsl 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
  • *.awk files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.d files are analyzed with DAnalyzer:
    • 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
  • *.hh files are analyzed with CppAnalyzer:
    • 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
  • *.yaml files are analyzed with YamlAnalyzer:
    • 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
  • *.tpl files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis


2022-01-30 07:30