microsoft / BPerf
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
S
man
tex
inl
in
csproj
cshtml
vcxproj
cxx
editorconfig
cmd
gitattributes
targets
s
cmake
props
nuspec
ini
m4
resx
  • 41 extensions are included in analyses: txt, cpp, c, h, cs, S, man, tex, inl, hpp, in, csproj, cshtml, sh, json, css, js, inc, md, gitignore, vcxproj, cxx, editorconfig, cmd, gitattributes, targets, s, cmake, pl, py, ps1, bat, xml, yaml, props, nuspec, yml, ini, svg, m4, resx
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (16 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (1 file).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (1 file).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (1 file).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 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).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (1283 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.

main244948 LOC (76%) 1405 files
test71738 LOC (22%) 1033 files
generated242 LOC (<1%) 2 files
build and deployment390 LOC (<1%) 22 files
other2271 LOC (<1%) 13 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
inl
man
s
tex
cmake
in
cshtml
vcxproj
cmd
props
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1405 files match defined criteria (244,948 lines of code, 100.0% vs. main code):
    • 458 *.h files (124,553 lines of code)
    • 139 *.cpp files (58,554 lines of code)
    • 455 *.c files (21,860 lines of code)
    • 134 *.cs files (11,859 lines of code)
    • 28 *.inl files (10,082 lines of code)
    • 33 *.man files (4,608 lines of code)
    • 28 *.hpp files (4,439 lines of code)
    • 49 *.s files (2,548 lines of code)
    • 32 *.tex files (2,511 lines of code)
    • 2 *.cmake files (1,289 lines of code)
    • 5 *.inc files (706 lines of code)
    • 18 *.in files (648 lines of code)
    • 2 *.pl files (438 lines of code)
    • 12 *.cshtml files (408 lines of code)
    • 3 *.vcxproj files (260 lines of code)
    • 1 *.ps1 files (69 lines of code)
    • 2 *.cmd files (44 lines of code)
    • 1 *.props files (42 lines of code)
    • 2 *.targets files (22 lines of code)
    • 1 *.py files (8 lines of code)
  • " *.h" is biggest, containing 50.85% of code.
  • " *.py" is smallest, containing 0% of code.


*.h124553 LOC (50%) 458 files
*.cpp58554 LOC (23%) 139 files
*.c21860 LOC (8%) 455 files
*.cs11859 LOC (4%) 134 files
*.inl10082 LOC (4%) 28 files
*.man4608 LOC (1%) 33 files
*.hpp4439 LOC (1%) 28 files
*.s2548 LOC (1%) 49 files
*.tex2511 LOC (1%) 32 files
*.cmake1289 LOC (<1%) 2 files
*.inc706 LOC (<1%) 5 files
*.in648 LOC (<1%) 18 files
*.pl438 LOC (<1%) 2 files
*.cshtml408 LOC (<1%) 12 files
*.vcxproj260 LOC (<1%) 3 files
*.ps169 LOC (<1%) 1 files
*.cmd44 LOC (<1%) 2 files
*.props42 LOC (<1%) 1 files
*.targets22 LOC (<1%) 2 files
*.py8 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
s
in
cxx
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 1033 files match defined criteria (71,738 lines of code, 29.3% vs. main code):
    • 898 *.cpp files (58,513 lines of code)
    • 85 *.c files (8,041 lines of code)
    • 36 *.h files (3,224 lines of code)
    • 9 *.s files (1,348 lines of code)
    • 1 *.in files (358 lines of code)
    • 1 *.sh files (136 lines of code)
    • 3 *.cxx files (118 lines of code)
  • " *.cpp" is biggest, containing 81.56% of code.
  • " *.cxx" is smallest, containing 0.16% of code.


*.cpp58513 LOC (81%) 898 files
*.c8041 LOC (11%) 85 files
*.h3224 LOC (4%) 36 files
*.s1348 LOC (1%) 9 files
*.in358 LOC (<1%) 1 files
*.sh136 LOC (<1%) 1 files
*.cxx118 LOC (<1%) 3 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 2 files match defined criteria (242 lines of code, 0.1% vs. main code). All matches are in *.cs files.


*.cs242 LOC (100%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
nuspec
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 ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
  • 22 files match defined criteria (390 lines of code, 0.2% vs. main code):
    • 14 *.csproj files (244 lines of code)
    • 6 *.sh files (117 lines of code)
    • 1 *.nuspec files (22 lines of code)
    • 1 *.bat files (7 lines of code)
  • " *.csproj" is biggest, containing 62.56% of code.
  • " *.bat" is smallest, containing 1.79% of code.


*.csproj244 LOC (62%) 14 files
*.sh117 LOC (30%) 6 files
*.nuspec22 LOC (5%) 1 files
*.bat7 LOC (1%) 1 files
Other Code
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • 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 ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 13 files match defined criteria (2,271 lines of code, 0.9% vs. main code):
    • 1 *.xml files (1,914 lines of code)
    • 5 *.json files (199 lines of code)
    • 1 *.ini files (103 lines of code)
    • 2 *.cpp files (40 lines of code)
    • 4 *.md files (15 lines of code)
  • " *.xml" is biggest, containing 84.28% of code.
  • " *.md" is smallest, containing 0.66% of code.


*.xml1914 LOC (84%) 1 files
*.json199 LOC (8%) 5 files
*.ini103 LOC (4%) 1 files
*.cpp40 LOC (1%) 2 files
*.md15 LOC (<1%) 4 files
Analyzers
Info about analyzers used for source code examinations.
  • *.h 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
  • *.cpp 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
  • *.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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 namespace heuristics)
  • *.inl 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
  • *.man 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
  • *.hpp 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
  • *.s 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
  • *.tex 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
  • *.cmake 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
  • *.inc 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
  • *.in files are analyzed with RustAnalyzer:
    • 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
  • *.pl files are analyzed with PerlAnalyzer:
    • 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
  • *.cshtml 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
  • *.vcxproj 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
  • *.ps1 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
  • *.cmd 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
  • *.props 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
  • *.targets 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
  • *.py files are analyzed with PythonAnalyzer:
    • 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


2022-01-30 13:53