microsoft / HoloLensForCV
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
xaml
props
hlsl
csproj
gitattributes
targets
nuspec
txt
  • 19 extensions are included in analyses: h, hpp, cpp, md, vcxproj, filters, xaml, props, cs, hlsl, py, xml, gitignore, csproj, gitattributes, targets, json, nuspec, txt
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (3 files).
    • exclude files with path like ".*/[Pp]ackages\/.+\.\d+\/.*" (NuGet) (178 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) (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.

main12096 LOC (65%) 179 files
test0 LOC (0%) 0 files
generated0 LOC (0%) 0 files
build and deployment304 LOC (1%) 2 files
other5935 LOC (32%) 89 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
filters
hlsl
props
xaml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 179 files match defined criteria (12,096 lines of code, 100.0% vs. main code):
    • 55 *.cpp files (5,545 lines of code)
    • 11 *.vcxproj files (2,789 lines of code)
    • 81 *.h files (2,004 lines of code)
    • 6 *.cs files (835 lines of code)
    • 11 *.filters files (554 lines of code)
    • 4 *.hlsl files (197 lines of code)
    • 7 *.props files (87 lines of code)
    • 4 *.xaml files (85 lines of code)
  • " *.cpp" is biggest, containing 45.84% of code.
  • " *.xaml" is smallest, containing 0.7% of code.


*.cpp5545 LOC (45%) 55 files
*.vcxproj2789 LOC (23%) 11 files
*.h2004 LOC (16%) 81 files
*.cs835 LOC (6%) 6 files
*.filters554 LOC (4%) 11 files
*.hlsl197 LOC (1%) 4 files
*.props87 LOC (<1%) 7 files
*.xaml85 LOC (<1%) 4 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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".
  • 2 files match defined criteria (304 lines of code, 2.5% vs. main code). All matches are in *.csproj files.


*.csproj304 LOC (100%) 2 files
Other Code
vcxproj
xaml
filters
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 ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 89 files match defined criteria (5,935 lines of code, 49.1% vs. main code):
    • 21 *.cpp files (2,327 lines of code)
    • 5 *.vcxproj files (1,123 lines of code)
    • 3 *.py files (735 lines of code)
    • 9 *.xaml files (681 lines of code)
    • 24 *.h files (644 lines of code)
    • 5 *.filters files (288 lines of code)
    • 20 *.md files (127 lines of code)
    • 2 *.xml files (10 lines of code)
  • " *.cpp" is biggest, containing 39.21% of code.
  • " *.xml" is smallest, containing 0.17% of code.


*.cpp2327 LOC (39%) 21 files
*.vcxproj1123 LOC (18%) 5 files
*.py735 LOC (12%) 3 files
*.xaml681 LOC (11%) 9 files
*.h644 LOC (10%) 24 files
*.filters288 LOC (4%) 5 files
*.md127 LOC (2%) 20 files
*.xml10 LOC (<1%) 2 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
  • *.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
  • *.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
  • *.hlsl 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
  • *.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 15:05