microsoft / Azure-Kinect-Samples
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
txt
vcxproj
filters
xaml
csproj
resx
gitattributes
gitmodules
  • 23 extensions are included in analyses: meta, cs, h, cpp, mat, asset, md, txt, vcxproj, filters, xaml, csproj, resx, prefab, unity, json, c, py, gitattributes, bat, yml, gitignore, gitmodules
  • 7 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 ".*/extern(al)?/.*" (Dependencies) (2 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (4 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) (8 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.

main31747 LOC (82%) 162 files
test0 LOC (0%) 0 files
generated5463 LOC (14%) 88 files
build and deployment967 LOC (2%) 6 files
other391 LOC (1%) 16 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
mat
asset
vcxproj
filters
xaml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 162 files match defined criteria (31,747 lines of code, 100.0% vs. main code):
    • 3 *.prefab files (11,598 lines of code)
    • 26 *.h files (4,739 lines of code)
    • 24 *.cpp files (4,495 lines of code)
    • 39 *.cs files (2,979 lines of code)
    • 21 *.mat files (1,802 lines of code)
    • 2 *.c files (1,597 lines of code)
    • 17 *.asset files (1,563 lines of code)
    • 2 *.unity files (1,214 lines of code)
    • 10 *.vcxproj files (1,125 lines of code)
    • 8 *.filters files (337 lines of code)
    • 8 *.xaml files (252 lines of code)
    • 1 *.py files (34 lines of code)
    • 1 *.yml files (12 lines of code)
  • " *.prefab" is biggest, containing 36.53% of code.
  • " *.yml" is smallest, containing 0.04% of code.


*.prefab11598 LOC (36%) 3 files
*.h4739 LOC (14%) 26 files
*.cpp4495 LOC (14%) 24 files
*.cs2979 LOC (9%) 39 files
*.mat1802 LOC (5%) 21 files
*.c1597 LOC (5%) 2 files
*.asset1563 LOC (4%) 17 files
*.unity1214 LOC (3%) 2 files
*.vcxproj1125 LOC (3%) 10 files
*.filters337 LOC (1%) 8 files
*.xaml252 LOC (<1%) 8 files
*.py34 LOC (<1%) 1 files
*.yml12 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 88 files match defined criteria (5,463 lines of code, 17.2% vs. main code):
    • 80 *.meta files (5,179 lines of code)
    • 8 *.cs files (284 lines of code)
  • " *.meta" is biggest, containing 94.8% of code.
  • " *.cs" is smallest, containing 5.2% of code.


*.meta5179 LOC (94%) 80 files
*.cs284 LOC (5%) 8 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 ".*/[.]gitmodules".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]bat".
  • 6 files match defined criteria (967 lines of code, 3.0% vs. main code):
    • 5 *.csproj files (934 lines of code)
    • 1 *.bat files (33 lines of code)
  • " *.csproj" is biggest, containing 96.59% of code.
  • " *.bat" is smallest, containing 3.41% of code.


*.csproj934 LOC (96%) 5 files
*.bat33 LOC (3%) 1 files
Other Code
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]+".
  • 16 files match defined criteria (391 lines of code, 1.2% vs. main code):
    • 15 *.md files (328 lines of code)
    • 1 *.json files (63 lines of code)
  • " *.md" is biggest, containing 83.89% of code.
  • " *.json" is smallest, containing 16.11% of code.


*.md328 LOC (83%) 15 files
*.json63 LOC (16%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-31 00:58