microsoft / MixedRealityLearning
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
shader
txt
cginc
nuspec
targets
gitattributes
pri
  • 22 extensions are included in analyses: meta, cs, mat, prefab, asset, anim, shader, txt, md, json, unity, cginc, yml, xml, gitignore, nuspec, targets, js, gitattributes, mm, pri, gradle
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (2 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) (58 files).
    • exclude files with path like ".*/ThirdParty/.*" (3rd library libraries) (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.

main1259410 LOC (79%) 3432 files
test0 LOC (0%) 0 files
generated111634 LOC (7%) 5257 files
build and deployment178 LOC (<1%) 4 files
other204881 LOC (12%) 675 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
anim
mat
asset
shader
cginc
targets
pri
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 3432 files match defined criteria (1,259,410 lines of code, 100.0% vs. main code):
    • 78 *.anim files (539,760 lines of code)
    • 341 *.prefab files (319,745 lines of code)
    • 2,276 *.cs files (252,468 lines of code)
    • 339 *.mat files (56,056 lines of code)
    • 297 *.asset files (54,633 lines of code)
    • 11 *.unity files (22,543 lines of code)
    • 63 *.shader files (12,768 lines of code)
    • 12 *.cginc files (765 lines of code)
    • 1 *.js files (492 lines of code)
    • 10 *.yml files (92 lines of code)
    • 2 *.targets files (80 lines of code)
    • 1 *.mm files (7 lines of code)
    • 1 *.pri files (1 lines of code)
  • " *.anim" is biggest, containing 42.86% of code.
  • " *.pri" is smallest, containing 0% of code.


*.anim539760 LOC (42%) 78 files
*.prefab319745 LOC (25%) 341 files
*.cs252468 LOC (20%) 2276 files
*.mat56056 LOC (4%) 339 files
*.asset54633 LOC (4%) 297 files
*.unity22543 LOC (1%) 11 files
*.shader12768 LOC (1%) 63 files
*.cginc765 LOC (<1%) 12 files
*.js492 LOC (<1%) 1 files
*.yml92 LOC (<1%) 10 files
*.targets80 LOC (<1%) 2 files
*.mm7 LOC (<1%) 1 files
*.pri1 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[:] .*".
    • files with paths like ".*/package[-]lock[.]json".
  • 5257 files match defined criteria (111,634 lines of code, 8.9% vs. main code):
    • 5,256 *.meta files (110,742 lines of code)
    • 1 *.json files (892 lines of code)
  • " *.meta" is biggest, containing 99.2% of code.
  • " *.json" is smallest, containing 0.8% of code.


*.meta110742 LOC (99%) 5256 files
*.json892 LOC (<1%) 1 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[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]gradle".
  • 4 files match defined criteria (178 lines of code, 0.0% vs. main code):
    • 1 *.gradle files (94 lines of code)
    • 3 *.nuspec files (84 lines of code)
  • " *.gradle" is biggest, containing 52.81% of code.
  • " *.nuspec" is smallest, containing 47.19% of code.


*.gradle94 LOC (52%) 1 files
*.nuspec84 LOC (47%) 3 files
Other Code
meta
mat
shader
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 ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 675 files match defined criteria (204,881 lines of code, 16.3% vs. main code):
    • 13 *.unity files (131,898 lines of code)
    • 359 *.meta files (26,722 lines of code)
    • 23 *.prefab files (13,493 lines of code)
    • 40 *.json files (12,360 lines of code)
    • 118 *.cs files (8,013 lines of code)
    • 58 *.mat files (5,992 lines of code)
    • 5 *.xml files (5,513 lines of code)
    • 58 *.md files (873 lines of code)
    • 1 *.shader files (17 lines of code)
  • " *.unity" is biggest, containing 64.38% of code.
  • " *.shader" is smallest, containing 0.01% of code.


*.unity131898 LOC (64%) 13 files
*.meta26722 LOC (13%) 359 files
*.prefab13493 LOC (6%) 23 files
*.json12360 LOC (6%) 40 files
*.cs8013 LOC (3%) 118 files
*.mat5992 LOC (2%) 58 files
*.xml5513 LOC (2%) 5 files
*.md873 LOC (<1%) 58 files
*.shader17 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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.mm 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
  • *.pri 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-31 00:57