microsoft / MapsSDK-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
asset
shader
mat
cginc
txt
  • 15 extensions are included in analyses: meta, cs, asset, shader, mat, prefab, unity, cginc, txt, md, json, gitignore, gradle, svg, xml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 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) (6 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.

main56141 LOC (91%) 206 files
test0 LOC (0%) 0 files
generated4063 LOC (6%) 316 files
build and deployment120 LOC (<1%) 2 files
other750 LOC (1%) 11 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
asset
shader
mat
cginc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 206 files match defined criteria (56,141 lines of code, 100.0% vs. main code):
    • 9 *.unity files (25,171 lines of code)
    • 46 *.asset files (9,365 lines of code)
    • 9 *.prefab files (8,868 lines of code)
    • 85 *.cs files (5,814 lines of code)
    • 26 *.shader files (4,601 lines of code)
    • 23 *.mat files (1,885 lines of code)
    • 8 *.cginc files (437 lines of code)
  • " *.unity" is biggest, containing 44.84% of code.
  • " *.cginc" is smallest, containing 0.78% of code.


*.unity25171 LOC (44%) 9 files
*.asset9365 LOC (16%) 46 files
*.prefab8868 LOC (15%) 9 files
*.cs5814 LOC (10%) 85 files
*.shader4601 LOC (8%) 26 files
*.mat1885 LOC (3%) 23 files
*.cginc437 LOC (<1%) 8 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[:] .*".
  • 316 files match defined criteria (4,063 lines of code, 7.2% vs. main code). All matches are in *.meta files.


*.meta4063 LOC (100%) 316 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/package[.]json".
  • 2 files match defined criteria (120 lines of code, 0.2% vs. main code). All matches are in *.gradle files.


*.gradle120 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 ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 11 files match defined criteria (750 lines of code, 1.3% vs. main code):
    • 4 *.md files (363 lines of code)
    • 4 *.json files (268 lines of code)
    • 1 *.svg files (90 lines of code)
    • 1 *.xml files (22 lines of code)
    • 1 *.meta files (7 lines of code)
  • " *.md" is biggest, containing 48.4% of code.
  • " *.meta" is smallest, containing 0.93% of code.


*.md363 LOC (48%) 4 files
*.json268 LOC (35%) 4 files
*.svg90 LOC (12%) 1 files
*.xml22 LOC (2%) 1 files
*.meta7 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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-31 01:07