microsoft / devkit-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
ino
txt
properties
pde
csx
vcxproj
adoc
babelrc
filters
csproj
ld
  • 23 extensions are included in analyses: h, json, cpp, c, ino, md, txt, properties, xml, pde, js, yml, cs, ps1, py, csx, vcxproj, adoc, gitignore, babelrc, filters, csproj, ld
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (70 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (35 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) (10 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.

main111524 LOC (93%) 843 files
test1046 LOC (<1%) 15 files
generated0 LOC (0%) 0 files
build and deployment74 LOC (<1%) 1 files
other6390 LOC (5%) 68 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
ld
filters
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 843 files match defined criteria (111,524 lines of code, 100.0% vs. main code):
    • 714 *.h files (84,875 lines of code)
    • 46 *.c files (14,709 lines of code)
    • 64 *.cpp files (10,281 lines of code)
    • 5 *.cs files (736 lines of code)
    • 4 *.js files (245 lines of code)
    • 3 *.ps1 files (210 lines of code)
    • 1 *.vcxproj files (140 lines of code)
    • 1 *.ld files (138 lines of code)
    • 1 *.filters files (117 lines of code)
    • 2 *.py files (49 lines of code)
    • 2 *.yml files (24 lines of code)
  • " *.h" is biggest, containing 76.1% of code.
  • " *.yml" is smallest, containing 0.02% of code.


*.h84875 LOC (76%) 714 files
*.c14709 LOC (13%) 46 files
*.cpp10281 LOC (9%) 64 files
*.cs736 LOC (<1%) 5 files
*.js245 LOC (<1%) 4 files
*.ps1210 LOC (<1%) 3 files
*.vcxproj140 LOC (<1%) 1 files
*.ld138 LOC (<1%) 1 files
*.filters117 LOC (<1%) 1 files
*.py49 LOC (<1%) 2 files
*.yml24 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
ino
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/UnitTests?/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 15 files match defined criteria (1,046 lines of code, 0.9% vs. main code):
    • 10 *.ino files (851 lines of code)
    • 1 *.cpp files (128 lines of code)
    • 4 *.h files (67 lines of code)
  • " *.ino" is biggest, containing 81.36% of code.
  • " *.h" is smallest, containing 6.41% of code.


*.ino851 LOC (81%) 10 files
*.cpp128 LOC (12%) 1 files
*.h67 LOC (6%) 4 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 ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*/package[.]json".
  • 1 file matches defined criteria (74 lines of code, 0.1% vs. main code). All matches are in *.csproj files.


*.csproj74 LOC (100%) 1 files
Other Code
ino
pde
csx
properties
adoc
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 ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 68 files match defined criteria (6,390 lines of code, 5.7% vs. main code):
    • 8 *.json files (3,159 lines of code)
    • 17 *.ino files (1,534 lines of code)
    • 6 *.xml files (601 lines of code)
    • 1 *.cpp files (320 lines of code)
    • 6 *.pde files (193 lines of code)
    • 1 *.csx files (171 lines of code)
    • 15 *.md files (158 lines of code)
    • 1 *.js files (114 lines of code)
    • 11 *.properties files (99 lines of code)
    • 1 *.h files (21 lines of code)
    • 1 *.adoc files (20 lines of code)
  • " *.json" is biggest, containing 49.44% of code.
  • " *.adoc" is smallest, containing 0.31% of code.


*.json3159 LOC (49%) 8 files
*.ino1534 LOC (24%) 17 files
*.xml601 LOC (9%) 6 files
*.cpp320 LOC (5%) 1 files
*.pde193 LOC (3%) 6 files
*.csx171 LOC (2%) 1 files
*.md158 LOC (2%) 15 files
*.js114 LOC (1%) 1 files
*.properties99 LOC (1%) 11 files
*.h21 LOC (<1%) 1 files
*.adoc20 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.ld 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
  • *.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
  • *.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-30 14:50