microsoft / MixedReality-WorldLockingTools-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
gitattributes
targets
cginc
npmrc
cmd
  • 25 extensions are included in analyses: meta, cs, prefab, mat, asset, md, anim, txt, json, unity, shader, yml, js, nuspec, svg, css, gitattributes, targets, ps1, xml, cginc, html, npmrc, gitignore, cmd
  • 5 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 ".*/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) (25 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.

main685227 LOC (91%) 1986 files
test4227 LOC (<1%) 15 files
generated46570 LOC (6%) 2805 files
build and deployment59 LOC (<1%) 2 files
other10092 LOC (1%) 96 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
cmd
targets
cginc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1986 files match defined criteria (685,227 lines of code, 100.0% vs. main code):
    • 46 *.anim files (272,202 lines of code)
    • 204 *.prefab files (149,127 lines of code)
    • 1,334 *.cs files (146,043 lines of code)
    • 14 *.unity files (48,620 lines of code)
    • 166 *.asset files (35,333 lines of code)
    • 186 *.mat files (29,102 lines of code)
    • 16 *.shader files (4,224 lines of code)
    • 12 *.yml files (197 lines of code)
    • 1 *.ps1 files (156 lines of code)
    • 2 *.js files (68 lines of code)
    • 1 *.cmd files (56 lines of code)
    • 1 *.targets files (36 lines of code)
    • 1 *.css files (33 lines of code)
    • 1 *.cginc files (25 lines of code)
    • 1 *.html files (5 lines of code)
  • " *.anim" is biggest, containing 39.72% of code.
  • " *.html" is smallest, containing 0% of code.


*.anim272202 LOC (39%) 46 files
*.prefab149127 LOC (21%) 204 files
*.cs146043 LOC (21%) 1334 files
*.unity48620 LOC (7%) 14 files
*.asset35333 LOC (5%) 166 files
*.mat29102 LOC (4%) 186 files
*.shader4224 LOC (<1%) 16 files
*.yml197 LOC (<1%) 12 files
*.ps1156 LOC (<1%) 1 files
*.js68 LOC (<1%) 2 files
*.cmd56 LOC (<1%) 1 files
*.targets36 LOC (<1%) 1 files
*.css33 LOC (<1%) 1 files
*.cginc25 LOC (<1%) 1 files
*.html5 LOC (<1%) 1 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 ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 15 files match defined criteria (4,227 lines of code, 0.6% vs. main code):
    • 6 *.cs files (1,722 lines of code)
    • 5 *.prefab files (1,575 lines of code)
    • 4 *.unity files (930 lines of code)
  • " *.cs" is biggest, containing 40.74% of code.
  • " *.unity" is smallest, containing 22% of code.


*.cs1722 LOC (40%) 6 files
*.prefab1575 LOC (37%) 5 files
*.unity930 LOC (22%) 4 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[:] .*".
  • 2805 files match defined criteria (46,570 lines of code, 6.8% vs. main code). All matches are in *.meta files.


*.meta46570 LOC (100%) 2805 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*/package[.]json".
  • 2 files match defined criteria (59 lines of code, 0.0% vs. main code). All matches are in *.nuspec files.


*.nuspec59 LOC (100%) 2 files
Other Code
meta
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 ".*[.]npmrc".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 96 files match defined criteria (10,092 lines of code, 1.5% vs. main code):
    • 20 *.json files (5,985 lines of code)
    • 72 *.md files (3,882 lines of code)
    • 1 *.svg files (105 lines of code)
    • 1 *.yml files (90 lines of code)
    • 1 *.xml files (22 lines of code)
    • 1 *.meta files (8 lines of code)
  • " *.json" is biggest, containing 59.3% of code.
  • " *.meta" is smallest, containing 0.08% of code.


*.json5985 LOC (59%) 20 files
*.md3882 LOC (38%) 72 files
*.svg105 LOC (1%) 1 files
*.yml90 LOC (<1%) 1 files
*.xml22 LOC (<1%) 1 files
*.meta8 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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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


2022-01-31 01:13