microsoft / Windows-AppConsult-Samples-UWP
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
plist
properties
gitattributes
watchmanconfig
vcxproj
filters
pro
props
targets
storyboard
resx
txt
  • 28 extensions are included in analyses: cs, xaml, xml, js, csproj, h, json, plist, cpp, gitignore, m, gradle, java, properties, gitattributes, watchmanconfig, bat, bzl, vcxproj, md, filters, pro, props, targets, xib, storyboard, resx, txt
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (14 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (2 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (2 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) (0 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.

main3468 LOC (50%) 121 files
test12 LOC (<1%) 2 files
generated58 LOC (<1%) 2 files
build and deployment2542 LOC (37%) 24 files
other759 LOC (11%) 39 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
xaml
filters
props
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 121 files match defined criteria (3,468 lines of code, 100.0% vs. main code):
    • 45 *.cs files (1,869 lines of code)
    • 2 *.vcxproj files (381 lines of code)
    • 28 *.xaml files (329 lines of code)
    • 6 *.m files (188 lines of code)
    • 10 *.js files (166 lines of code)
    • 8 *.cpp files (124 lines of code)
    • 11 *.h files (124 lines of code)
    • 2 *.filters files (121 lines of code)
    • 4 *.java files (113 lines of code)
    • 2 *.bzl files (34 lines of code)
    • 2 *.props files (14 lines of code)
    • 1 *.targets files (5 lines of code)
  • " *.cs" is biggest, containing 53.89% of code.
  • " *.targets" is smallest, containing 0.14% of code.


*.cs1869 LOC (53%) 45 files
*.vcxproj381 LOC (10%) 2 files
*.xaml329 LOC (9%) 28 files
*.m188 LOC (5%) 6 files
*.js166 LOC (4%) 10 files
*.cpp124 LOC (3%) 8 files
*.h124 LOC (3%) 11 files
*.filters121 LOC (3%) 2 files
*.java113 LOC (3%) 4 files
*.bzl34 LOC (<1%) 2 files
*.props14 LOC (<1%) 2 files
*.targets5 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*__tests__.*".
    • files with any line of content like ".*/simpletest/.*".
  • 2 files match defined criteria (12 lines of code, 0.3% vs. main code). All matches are in *.js files.


*.js12 LOC (100%) 2 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 "[/][/][ ]*".
  • 2 files match defined criteria (58 lines of code, 1.7% vs. main code). All matches are in *.cs files.


*.cs58 LOC (100%) 2 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 ".*/[.]gitattributes".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]csproj".
  • 24 files match defined criteria (2,542 lines of code, 73.3% vs. main code):
    • 16 *.csproj files (2,152 lines of code)
    • 6 *.gradle files (236 lines of code)
    • 2 *.bat files (154 lines of code)
  • " *.csproj" is biggest, containing 84.66% of code.
  • " *.bat" is smallest, containing 6.06% of code.


*.csproj2152 LOC (84%) 16 files
*.gradle236 LOC (9%) 6 files
*.bat154 LOC (6%) 2 files
Other Code
plist
storyboard
properties
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 ".*[.]properties".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 39 files match defined criteria (759 lines of code, 21.9% vs. main code):
    • 8 *.plist files (316 lines of code)
    • 8 *.json files (154 lines of code)
    • 17 *.xml files (118 lines of code)
    • 1 *.storyboard files (57 lines of code)
    • 1 *.xib files (42 lines of code)
    • 2 *.properties files (38 lines of code)
    • 2 *.md files (34 lines of code)
  • " *.plist" is biggest, containing 41.63% of code.
  • " *.md" is smallest, containing 4.48% of code.


*.plist316 LOC (41%) 8 files
*.json154 LOC (20%) 8 files
*.xml118 LOC (15%) 17 files
*.storyboard57 LOC (7%) 1 files
*.xib42 LOC (5%) 1 files
*.properties38 LOC (5%) 2 files
*.md34 LOC (4%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.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
  • *.m 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 package names)
  • *.bzl 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
  • *.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
  • *.targets 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 20:07