microsoft / Windows-iotcore-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
xaml
csproj
vcxproj
filters
txt
scad
gitattributes
plist
Filters
shproj
sch
storyboard
cmd
Props
resx
vbproj
  • 35 extensions are included in analyses: cs, xaml, md, h, csproj, cpp, xml, vcxproj, filters, json, svg, css, ps1, txt, scad, js, gitignore, html, py, yaml, vb, gitattributes, plist, c, hpp, Filters, bat, shproj, sch, storyboard, cmd, Props, htm, resx, vbproj
  • 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 ".*/foundation[.](css|less|scss|styl)" (Foundation css) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (4 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (1 file).
    • 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) (9 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.

main6007 LOC (2%) 39 files
test0 LOC (0%) 0 files
generated4908 LOC (2%) 4 files
build and deployment171 LOC (<1%) 1 files
other222252 LOC (95%) 1855 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
filters
xaml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 39 files match defined criteria (6,007 lines of code, 100.0% vs. main code):
    • 10 *.cpp files (3,362 lines of code)
    • 7 *.vcxproj files (1,027 lines of code)
    • 4 *.cs files (376 lines of code)
    • 2 *.hpp files (324 lines of code)
    • 2 *.ps1 files (322 lines of code)
    • 7 *.filters files (227 lines of code)
    • 1 *.c files (142 lines of code)
    • 2 *.xaml files (103 lines of code)
    • 1 *.py files (69 lines of code)
    • 3 *.h files (55 lines of code)
  • " *.cpp" is biggest, containing 55.97% of code.
  • " *.h" is smallest, containing 0.92% of code.


*.cpp3362 LOC (55%) 10 files
*.vcxproj1027 LOC (17%) 7 files
*.cs376 LOC (6%) 4 files
*.hpp324 LOC (5%) 2 files
*.ps1322 LOC (5%) 2 files
*.filters227 LOC (3%) 7 files
*.c142 LOC (2%) 1 files
*.xaml103 LOC (1%) 2 files
*.py69 LOC (1%) 1 files
*.h55 LOC (<1%) 3 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 4 files match defined criteria (4,908 lines of code, 81.7% vs. main code). All matches are in *.cs files.


*.cs4908 LOC (100%) 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]vbproj".
    • files with paths like ".*[.]bat".
  • 1 file matches defined criteria (171 lines of code, 2.8% vs. main code). All matches are in *.csproj files.


*.csproj171 LOC (100%) 1 files
Other Code
csproj
xaml
vcxproj
filters
scad
sch
vbproj
plist
storyboard
cmd
props
shproj
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 ".*[.]md".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 1855 files match defined criteria (222,252 lines of code, 3699.9% vs. main code):
    • 807 *.cs files (73,287 lines of code)
    • 109 *.xml files (53,190 lines of code)
    • 195 *.md files (18,243 lines of code)
    • 122 *.csproj files (16,726 lines of code)
    • 108 *.cpp files (15,401 lines of code)
    • 251 *.xaml files (13,231 lines of code)
    • 122 *.h files (7,985 lines of code)
    • 9 *.css files (7,049 lines of code)
    • 28 *.vcxproj files (6,319 lines of code)
    • 5 *.html files (2,330 lines of code)
    • 14 *.svg files (2,209 lines of code)
    • 22 *.json files (1,864 lines of code)
    • 25 *.filters files (1,133 lines of code)
    • 3 *.js files (900 lines of code)
    • 3 *.py files (595 lines of code)
    • 8 *.scad files (467 lines of code)
    • 9 *.ps1 files (436 lines of code)
    • 1 *.sch files (408 lines of code)
    • 1 *.vbproj files (174 lines of code)
    • 1 *.htm files (65 lines of code)
    • 2 *.plist files (58 lines of code)
    • 2 *.vb files (50 lines of code)
    • 1 *.storyboard files (38 lines of code)
    • 1 *.bat files (26 lines of code)
    • 1 *.cmd files (20 lines of code)
    • 2 *.yaml files (16 lines of code)
    • 1 *.props files (16 lines of code)
    • 1 *.shproj files (12 lines of code)
    • 1 *.c files (4 lines of code)
  • " *.cs" is biggest, containing 32.97% of code.
  • " *.c" is smallest, containing 0% of code.


*.cs73287 LOC (32%) 807 files
*.xml53190 LOC (23%) 109 files
*.md18243 LOC (8%) 195 files
*.csproj16726 LOC (7%) 122 files
*.cpp15401 LOC (6%) 108 files
*.xaml13231 LOC (5%) 251 files
*.h7985 LOC (3%) 122 files
*.css7049 LOC (3%) 9 files
*.vcxproj6319 LOC (2%) 28 files
*.html2330 LOC (1%) 5 files
*.svg2209 LOC (<1%) 14 files
*.json1864 LOC (<1%) 22 files
*.filters1133 LOC (<1%) 25 files
*.js900 LOC (<1%) 3 files
*.py595 LOC (<1%) 3 files
*.scad467 LOC (<1%) 8 files
*.ps1436 LOC (<1%) 9 files
*.sch408 LOC (<1%) 1 files
*.vbproj174 LOC (<1%) 1 files
*.htm65 LOC (<1%) 1 files
*.plist58 LOC (<1%) 2 files
*.vb50 LOC (<1%) 2 files
*.storyboard38 LOC (<1%) 1 files
*.bat26 LOC (<1%) 1 files
*.cmd20 LOC (<1%) 1 files
*.yaml16 LOC (<1%) 2 files
*.props16 LOC (<1%) 1 files
*.shproj12 LOC (<1%) 1 files
*.c4 LOC (<1%) 1 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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-30 15:15