microsoft / xlang
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
vcxproj
filters
props
targets
nuspec
csproj
cmake
cmd
gitattributes
natvis
  • 24 extensions are included in analyses: h, cpp, txt, md, py, yml, vcxproj, filters, props, xml, targets, ps1, nuspec, gitignore, cs, csproj, sh, json, hpp, cmake, cmd, js, gitattributes, natvis
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (5 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) (28 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.

main73191 LOC (91%) 234 files
test3784 LOC (4%) 48 files
generated0 LOC (0%) 0 files
build and deployment242 LOC (<1%) 9 files
other2839 LOC (3%) 30 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
targets
filters
natvis
props
cmd
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 234 files match defined criteria (73,191 lines of code, 100.0% vs. main code):
    • 132 *.h files (26,273 lines of code)
    • 2 *.hpp files (25,804 lines of code)
    • 47 *.cpp files (14,694 lines of code)
    • 1 *.js files (3,158 lines of code)
    • 7 *.vcxproj files (1,443 lines of code)
    • 4 *.targets files (457 lines of code)
    • 12 *.yml files (394 lines of code)
    • 7 *.filters files (259 lines of code)
    • 3 *.cs files (242 lines of code)
    • 1 *.natvis files (151 lines of code)
    • 4 *.ps1 files (81 lines of code)
    • 7 *.props files (80 lines of code)
    • 2 *.cmd files (63 lines of code)
    • 3 *.py files (52 lines of code)
    • 2 *.cmake files (40 lines of code)
  • " *.h" is biggest, containing 35.9% of code.
  • " *.cmake" is smallest, containing 0.05% of code.


*.h26273 LOC (35%) 132 files
*.hpp25804 LOC (35%) 2 files
*.cpp14694 LOC (20%) 47 files
*.js3158 LOC (4%) 1 files
*.vcxproj1443 LOC (1%) 7 files
*.targets457 LOC (<1%) 4 files
*.yml394 LOC (<1%) 12 files
*.filters259 LOC (<1%) 7 files
*.cs242 LOC (<1%) 3 files
*.natvis151 LOC (<1%) 1 files
*.ps181 LOC (<1%) 4 files
*.props80 LOC (<1%) 7 files
*.cmd63 LOC (<1%) 2 files
*.py52 LOC (<1%) 3 files
*.cmake40 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 ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 48 files match defined criteria (3,784 lines of code, 5.2% vs. main code):
    • 28 *.cpp files (2,743 lines of code)
    • 14 *.py files (948 lines of code)
    • 6 *.h files (93 lines of code)
  • " *.cpp" is biggest, containing 72.49% of code.
  • " *.h" is smallest, containing 2.46% of code.


*.cpp2743 LOC (72%) 28 files
*.py948 LOC (25%) 14 files
*.h93 LOC (2%) 6 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
nuspec
csproj
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 ".*[.]sh".
  • 9 files match defined criteria (242 lines of code, 0.3% vs. main code):
    • 4 *.nuspec files (103 lines of code)
    • 2 *.sh files (75 lines of code)
    • 3 *.csproj files (64 lines of code)
  • " *.nuspec" is biggest, containing 42.56% of code.
  • " *.csproj" is smallest, containing 26.45% of code.


*.nuspec103 LOC (42%) 4 files
*.sh75 LOC (30%) 2 files
*.csproj64 LOC (26%) 3 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • 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)".
  • 30 files match defined criteria (2,839 lines of code, 3.9% vs. main code):
    • 20 *.md files (1,896 lines of code)
    • 2 *.cpp files (779 lines of code)
    • 1 *.py files (72 lines of code)
    • 1 *.json files (56 lines of code)
    • 5 *.xml files (30 lines of code)
    • 1 *.h files (6 lines of code)
  • " *.md" is biggest, containing 66.78% of code.
  • " *.h" is smallest, containing 0.21% of code.


*.md1896 LOC (66%) 20 files
*.cpp779 LOC (27%) 2 files
*.py72 LOC (2%) 1 files
*.json56 LOC (1%) 1 files
*.xml30 LOC (1%) 5 files
*.h6 LOC (<1%) 1 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.yml 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
  • *.filters 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
  • *.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)
  • *.natvis 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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-30 20:12