microsoft / Azure-Kinect-Sensor-SDK
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
txt
cmake
in
csproj
resx
xaml
gitattributes
vcxproj
editorconfig
clang-format
props
csh
gitmodules
  • 28 extensions are included in analyses: h, cpp, txt, cs, md, c, py, cmake, in, csproj, json, ps1, yml, html, gitignore, hpp, resx, xaml, css, gitattributes, sh, xml, vcxproj, editorconfig, clang-format, props, csh, gitmodules
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (12 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (11 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (17 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (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) (87 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.

main45775 LOC (59%) 284 files
test24191 LOC (31%) 103 files
generated155 LOC (<1%) 5 files
build and deployment322 LOC (<1%) 4 files
other5870 LOC (7%) 85 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
in
vcxproj
csh
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 284 files match defined criteria (45,775 lines of code, 100.0% vs. main code):
    • 52 *.cpp files (14,222 lines of code)
    • 30 *.c files (10,608 lines of code)
    • 100 *.h files (6,896 lines of code)
    • 45 *.cs files (3,888 lines of code)
    • 13 *.py files (2,994 lines of code)
    • 21 *.cmake files (2,761 lines of code)
    • 9 *.in files (1,815 lines of code)
    • 3 *.hpp files (1,320 lines of code)
    • 1 *.yml files (686 lines of code)
    • 4 *.ps1 files (220 lines of code)
    • 1 *.css files (137 lines of code)
    • 1 *.vcxproj files (95 lines of code)
    • 1 *.csh files (65 lines of code)
    • 2 *.html files (53 lines of code)
    • 1 *.props files (15 lines of code)
  • " *.cpp" is biggest, containing 31.07% of code.
  • " *.props" is smallest, containing 0.03% of code.


*.cpp14222 LOC (31%) 52 files
*.c10608 LOC (23%) 30 files
*.h6896 LOC (15%) 100 files
*.cs3888 LOC (8%) 45 files
*.py2994 LOC (6%) 13 files
*.cmake2761 LOC (6%) 21 files
*.in1815 LOC (3%) 9 files
*.hpp1320 LOC (2%) 3 files
*.yml686 LOC (1%) 1 files
*.ps1220 LOC (<1%) 4 files
*.css137 LOC (<1%) 1 files
*.vcxproj95 LOC (<1%) 1 files
*.csh65 LOC (<1%) 1 files
*.html53 LOC (<1%) 2 files
*.props15 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/UnitTests?/.*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 103 files match defined criteria (24,191 lines of code, 52.8% vs. main code):
    • 44 *.cpp files (15,676 lines of code)
    • 28 *.cs files (3,116 lines of code)
    • 4 *.py files (2,890 lines of code)
    • 6 *.c files (1,343 lines of code)
    • 17 *.h files (944 lines of code)
    • 4 *.csproj files (222 lines of code)
  • " *.cpp" is biggest, containing 64.8% of code.
  • " *.csproj" is smallest, containing 0.92% of code.


*.cpp15676 LOC (64%) 44 files
*.cs3116 LOC (12%) 28 files
*.py2890 LOC (11%) 4 files
*.c1343 LOC (5%) 6 files
*.h944 LOC (3%) 17 files
*.csproj222 LOC (<1%) 4 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 5 files match defined criteria (155 lines of code, 0.3% vs. main code):
    • 4 *.cs files (116 lines of code)
    • 1 *.html files (39 lines of code)
  • " *.cs" is biggest, containing 74.84% of code.
  • " *.html" is smallest, containing 25.16% of code.


*.cs116 LOC (74%) 4 files
*.html39 LOC (25%) 1 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 ".*[.]sh".
    • files with paths like ".*[.]csproj".
  • 4 files match defined criteria (322 lines of code, 0.7% vs. main code):
    • 3 *.csproj files (269 lines of code)
    • 1 *.sh files (53 lines of code)
  • " *.csproj" is biggest, containing 83.54% of code.
  • " *.sh" is smallest, containing 16.46% of code.


*.csproj269 LOC (83%) 3 files
*.sh53 LOC (16%) 1 files
Other Code
csproj
xaml
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 ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 85 files match defined criteria (5,870 lines of code, 12.8% vs. main code):
    • 10 *.cpp files (2,044 lines of code)
    • 28 *.md files (782 lines of code)
    • 7 *.py files (578 lines of code)
    • 10 *.h files (488 lines of code)
    • 11 *.cs files (479 lines of code)
    • 4 *.c files (462 lines of code)
    • 7 *.json files (391 lines of code)
    • 2 *.csproj files (371 lines of code)
    • 1 *.xml files (182 lines of code)
    • 3 *.yml files (63 lines of code)
    • 2 *.xaml files (30 lines of code)
  • " *.cpp" is biggest, containing 34.82% of code.
  • " *.xaml" is smallest, containing 0.51% of code.


*.cpp2044 LOC (34%) 10 files
*.md782 LOC (13%) 28 files
*.py578 LOC (9%) 7 files
*.h488 LOC (8%) 10 files
*.cs479 LOC (8%) 11 files
*.c462 LOC (7%) 4 files
*.json391 LOC (6%) 7 files
*.csproj371 LOC (6%) 2 files
*.xml182 LOC (3%) 1 files
*.yml63 LOC (1%) 3 files
*.xaml30 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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)
  • *.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
  • *.cmake 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
  • *.in files are analyzed with RustAnalyzer:
    • 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
  • *.hpp 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
  • *.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
  • *.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
  • *.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
  • *.csh 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
  • *.props 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


2022-01-30 22:32