microsoft / MixedRealityToolkit-Unity
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
meta
mat
asset
anim
txt
shader
nuspec
npmignore
gltf
gitattributes
targets
cginc
proj
csproj
  • 29 extensions are included in analyses: meta, cs, mat, asset, prefab, unity, anim, yml, md, json, txt, ps1, shader, nuspec, npmignore, py, yaml, css, js, html, gitignore, gltf, gitattributes, targets, psm1, xml, cginc, proj, csproj
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (15 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (7 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (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) (22 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.

main615489 LOC (38%) 1849 files
test23829 LOC (1%) 137 files
generated63155 LOC (3%) 3636 files
build and deployment140 LOC (<1%) 5 files
other910807 LOC (56%) 1478 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
anim
asset
mat
shader
proj
targets
cginc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1849 files match defined criteria (615,489 lines of code, 100.0% vs. main code):
    • 46 *.anim files (272,211 lines of code)
    • 1,224 *.cs files (134,298 lines of code)
    • 171 *.prefab files (126,446 lines of code)
    • 159 *.asset files (34,678 lines of code)
    • 170 *.mat files (27,850 lines of code)
    • 6 *.unity files (11,840 lines of code)
    • 15 *.shader files (4,112 lines of code)
    • 16 *.ps1 files (2,649 lines of code)
    • 32 *.yml files (940 lines of code)
    • 3 *.py files (139 lines of code)
    • 1 *.psm1 files (119 lines of code)
    • 3 *.yaml files (108 lines of code)
    • 1 *.proj files (38 lines of code)
    • 1 *.targets files (36 lines of code)
    • 1 *.cginc files (25 lines of code)
  • " *.anim" is biggest, containing 44.23% of code.
  • " *.cginc" is smallest, containing 0% of code.


*.anim272211 LOC (44%) 46 files
*.cs134298 LOC (21%) 1224 files
*.prefab126446 LOC (20%) 171 files
*.asset34678 LOC (5%) 159 files
*.mat27850 LOC (4%) 170 files
*.unity11840 LOC (1%) 6 files
*.shader4112 LOC (<1%) 15 files
*.ps12649 LOC (<1%) 16 files
*.yml940 LOC (<1%) 32 files
*.py139 LOC (<1%) 3 files
*.psm1119 LOC (<1%) 1 files
*.yaml108 LOC (<1%) 3 files
*.proj38 LOC (<1%) 1 files
*.targets36 LOC (<1%) 1 files
*.cginc25 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
asset
nuspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/TestUtilities/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 137 files match defined criteria (23,829 lines of code, 3.9% vs. main code):
    • 110 *.cs files (20,390 lines of code)
    • 5 *.prefab files (2,569 lines of code)
    • 17 *.asset files (683 lines of code)
    • 2 *.ps1 files (111 lines of code)
    • 2 *.nuspec files (59 lines of code)
    • 1 *.py files (17 lines of code)
  • " *.cs" is biggest, containing 85.57% of code.
  • " *.py" is smallest, containing 0.07% of code.


*.cs20390 LOC (85%) 110 files
*.prefab2569 LOC (10%) 5 files
*.asset683 LOC (2%) 17 files
*.ps1111 LOC (<1%) 2 files
*.nuspec59 LOC (<1%) 2 files
*.py17 LOC (<1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
meta
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]meta" AND any line of content like ".*fileFormatVersion[:] .*".
  • 3636 files match defined criteria (63,155 lines of code, 10.3% vs. main code). All matches are in *.meta files.


*.meta63155 LOC (100%) 3636 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 ".*[.]nuspec".
    • files with paths like ".*[.]csproj".
  • 5 files match defined criteria (140 lines of code, 0.0% vs. main code):
    • 4 *.nuspec files (132 lines of code)
    • 1 *.csproj files (8 lines of code)
  • " *.nuspec" is biggest, containing 94.29% of code.
  • " *.csproj" is smallest, containing 5.71% of code.


*.nuspec132 LOC (94%) 4 files
*.csproj8 LOC (5%) 1 files
Other Code
mat
meta
asset
anim
gltf
nuspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 1478 files match defined criteria (910,807 lines of code, 148.0% vs. main code):
    • 88 *.unity files (708,416 lines of code)
    • 65 *.prefab files (126,744 lines of code)
    • 167 *.mat files (26,673 lines of code)
    • 904 *.meta files (17,587 lines of code)
    • 67 *.asset files (12,086 lines of code)
    • 124 *.cs files (10,141 lines of code)
    • 21 *.json files (5,995 lines of code)
    • 12 *.anim files (2,406 lines of code)
    • 25 *.md files (439 lines of code)
    • 2 *.gltf files (281 lines of code)
    • 1 *.nuspec files (30 lines of code)
    • 1 *.yml files (7 lines of code)
    • 1 *.xml files (2 lines of code)
  • " *.unity" is biggest, containing 77.78% of code.
  • " *.xml" is smallest, containing 0% of code.


*.unity708416 LOC (77%) 88 files
*.prefab126744 LOC (13%) 65 files
*.mat26673 LOC (2%) 167 files
*.meta17587 LOC (1%) 904 files
*.asset12086 LOC (1%) 67 files
*.cs10141 LOC (1%) 124 files
*.json5995 LOC (<1%) 21 files
*.anim2406 LOC (<1%) 12 files
*.md439 LOC (<1%) 25 files
*.gltf281 LOC (<1%) 2 files
*.nuspec30 LOC (<1%) 1 files
*.yml7 LOC (<1%) 1 files
*.xml2 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.anim 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
  • *.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)
  • *.prefab 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
  • *.asset 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
  • *.mat 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
  • *.unity 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
  • *.shader 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
  • *.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
  • *.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
  • *.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
  • *.psm1 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
  • *.yaml 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
  • *.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
  • *.cginc 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 13:26