microsoft / Win2D
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
targets
csproj
cmd
txt
props
vcxproj
proj
filters
xaml
gitattributes
nuspec
inl
  • 22 extensions are included in analyses: h, cpp, xml, cs, targets, csproj, cmd, txt, props, vcxproj, svg, yml, proj, filters, ps1, md, gitignore, json, xaml, gitattributes, nuspec, inl
  • 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) (26 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) (5 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.

main113893 LOC (77%) 556 files
test2167 LOC (1%) 15 files
generated4227 LOC (2%) 119 files
build and deployment372 LOC (<1%) 6 files
other25950 LOC (17%) 178 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
filters
vcxproj
cmd
proj
props
targets
inl
xaml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 556 files match defined criteria (113,893 lines of code, 100.0% vs. main code):
    • 191 *.cpp files (71,008 lines of code)
    • 281 *.h files (31,837 lines of code)
    • 43 *.cs files (7,564 lines of code)
    • 1 *.filters files (1,254 lines of code)
    • 2 *.vcxproj files (607 lines of code)
    • 3 *.ps1 files (368 lines of code)
    • 8 *.cmd files (272 lines of code)
    • 4 *.yml files (264 lines of code)
    • 2 *.proj files (232 lines of code)
    • 6 *.props files (206 lines of code)
    • 12 *.targets files (192 lines of code)
    • 1 *.inl files (73 lines of code)
    • 2 *.xaml files (16 lines of code)
  • " *.cpp" is biggest, containing 62.35% of code.
  • " *.xaml" is smallest, containing 0.01% of code.


*.cpp71008 LOC (62%) 191 files
*.h31837 LOC (27%) 281 files
*.cs7564 LOC (6%) 43 files
*.filters1254 LOC (1%) 1 files
*.vcxproj607 LOC (<1%) 2 files
*.ps1368 LOC (<1%) 3 files
*.cmd272 LOC (<1%) 8 files
*.yml264 LOC (<1%) 4 files
*.proj232 LOC (<1%) 2 files
*.props206 LOC (<1%) 6 files
*.targets192 LOC (<1%) 12 files
*.inl73 LOC (<1%) 1 files
*.xaml16 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
filters
vcxproj
csproj
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 15 files match defined criteria (2,167 lines of code, 1.9% vs. main code):
    • 3 *.filters files (838 lines of code)
    • 3 *.vcxproj files (576 lines of code)
    • 3 *.csproj files (463 lines of code)
    • 5 *.cs files (269 lines of code)
    • 1 *.cmd files (21 lines of code)
  • " *.filters" is biggest, containing 38.67% of code.
  • " *.cmd" is smallest, containing 0.97% of code.


*.filters838 LOC (38%) 3 files
*.vcxproj576 LOC (26%) 3 files
*.csproj463 LOC (21%) 3 files
*.cs269 LOC (12%) 5 files
*.cmd21 LOC (<1%) 1 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 ".*/generated/.*".
  • 119 files match defined criteria (4,227 lines of code, 3.7% vs. main code):
    • 60 *.cpp files (2,853 lines of code)
    • 59 *.h files (1,374 lines of code)
  • " *.cpp" is biggest, containing 67.49% of code.
  • " *.h" is smallest, containing 32.51% of code.


*.cpp2853 LOC (67%) 60 files
*.h1374 LOC (32%) 59 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".
  • 6 files match defined criteria (372 lines of code, 0.3% vs. main code):
    • 5 *.csproj files (334 lines of code)
    • 1 *.nuspec files (38 lines of code)
  • " *.csproj" is biggest, containing 89.78% of code.
  • " *.nuspec" is smallest, containing 10.22% of code.


*.csproj334 LOC (89%) 5 files
*.nuspec38 LOC (10%) 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 ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 178 files match defined criteria (25,950 lines of code, 22.8% vs. main code):
    • 169 *.xml files (23,202 lines of code)
    • 5 *.svg files (1,832 lines of code)
    • 3 *.md files (911 lines of code)
    • 1 *.json files (5 lines of code)
  • " *.xml" is biggest, containing 89.41% of code.
  • " *.json" is smallest, containing 0.02% of code.


*.xml23202 LOC (89%) 169 files
*.svg1832 LOC (7%) 5 files
*.md911 LOC (3%) 3 files
*.json5 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.proj 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
  • *.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
  • *.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
  • *.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


2022-01-30 08:55