microsoft / cppwinrt
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
vcxproj
filters
props
txt
resx
vstemplate
xaml
cmd
vsixmanifest
targets
csproj
gitattributes
Props
nuspec
natvis
  • 25 extensions are included in analyses: cpp, h, vcxproj, filters, props, txt, resx, vstemplate, md, xaml, cmd, vsixmanifest, xml, cs, asm, targets, csproj, json, hpp, gitattributes, Props, nuspec, natvis, inc, gitignore
  • 6 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 ".*[.]resx" (The resx resource files) (14 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) (15 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.

main25854 LOC (31%) 169 files
test54445 LOC (67%) 475 files
generated0 LOC (0%) 0 files
build and deployment365 LOC (<1%) 3 files
other257 LOC (<1%) 11 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
vstemplate
vsixmanifest
props
cmd
natvis
xaml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 169 files match defined criteria (25,854 lines of code, 100.0% vs. main code):
    • 83 *.h files (18,312 lines of code)
    • 11 *.vcxproj files (2,177 lines of code)
    • 28 *.cpp files (2,109 lines of code)
    • 1 *.inc files (1,018 lines of code)
    • 2 *.targets files (706 lines of code)
    • 7 *.filters files (445 lines of code)
    • 9 *.vstemplate files (368 lines of code)
    • 4 *.vsixmanifest files (162 lines of code)
    • 9 *.props files (159 lines of code)
    • 4 *.asm files (156 lines of code)
    • 4 *.cmd files (91 lines of code)
    • 1 *.natvis files (69 lines of code)
    • 4 *.xaml files (42 lines of code)
    • 2 *.cs files (40 lines of code)
  • " *.h" is biggest, containing 70.83% of code.
  • " *.cs" is smallest, containing 0.15% of code.


*.h18312 LOC (70%) 83 files
*.vcxproj2177 LOC (8%) 11 files
*.cpp2109 LOC (8%) 28 files
*.inc1018 LOC (3%) 1 files
*.targets706 LOC (2%) 2 files
*.filters445 LOC (1%) 7 files
*.vstemplate368 LOC (1%) 9 files
*.vsixmanifest162 LOC (<1%) 4 files
*.props159 LOC (<1%) 9 files
*.asm156 LOC (<1%) 4 files
*.cmd91 LOC (<1%) 4 files
*.natvis69 LOC (<1%) 1 files
*.xaml42 LOC (<1%) 4 files
*.cs40 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
vcxproj
filters
csproj
props
cmd
xaml
targets
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 ".*/UnitTests?/.*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 475 files match defined criteria (54,445 lines of code, 210.6% vs. main code):
    • 316 *.cpp files (23,347 lines of code)
    • 2 *.hpp files (13,694 lines of code)
    • 33 *.vcxproj files (11,036 lines of code)
    • 87 *.h files (5,512 lines of code)
    • 20 *.filters files (598 lines of code)
    • 1 *.csproj files (109 lines of code)
    • 9 *.props files (77 lines of code)
    • 2 *.cs files (28 lines of code)
    • 2 *.cmd files (22 lines of code)
    • 2 *.xaml files (18 lines of code)
    • 1 *.targets files (4 lines of code)
  • " *.cpp" is biggest, containing 42.88% of code.
  • " *.targets" is smallest, containing 0.01% of code.


*.cpp23347 LOC (42%) 316 files
*.hpp13694 LOC (25%) 2 files
*.vcxproj11036 LOC (20%) 33 files
*.h5512 LOC (10%) 87 files
*.filters598 LOC (1%) 20 files
*.csproj109 LOC (<1%) 1 files
*.props77 LOC (<1%) 9 files
*.cs28 LOC (<1%) 2 files
*.cmd22 LOC (<1%) 2 files
*.xaml18 LOC (<1%) 2 files
*.targets4 LOC (<1%) 1 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 ".*[.]nuspec".
    • files with paths like ".*[.]csproj".
  • 3 files match defined criteria (365 lines of code, 1.4% vs. main code):
    • 2 *.csproj files (335 lines of code)
    • 1 *.nuspec files (30 lines of code)
  • " *.csproj" is biggest, containing 91.78% of code.
  • " *.nuspec" is smallest, containing 8.22% of code.


*.csproj335 LOC (91%) 2 files
*.nuspec30 LOC (8%) 1 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 ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 11 files match defined criteria (257 lines of code, 1.0% vs. main code):
    • 6 *.md files (155 lines of code)
    • 4 *.xml files (92 lines of code)
    • 1 *.json files (10 lines of code)
  • " *.md" is biggest, containing 60.31% of code.
  • " *.json" is smallest, containing 3.89% of code.


*.md155 LOC (60%) 6 files
*.xml92 LOC (35%) 4 files
*.json10 LOC (3%) 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.vstemplate 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
  • *.vsixmanifest 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
  • *.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
  • *.asm 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
  • *.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
  • *.xaml 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)


2022-01-30 13:56