microsoft / devops-project-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
cshtml
txt
csproj
prefs
gitattributes
tpl
pug
ejs
project
classpath
styl
editorconfig
htaccess
asax
properties
jshintrc
nuspec
dockerignore
ru
npmignore
jscsrc
sfproj
  • 48 extensions are included in analyses: js, svg, json, css, cshtml, cs, php, md, gitignore, less, yaml, py, txt, xml, html, rb, csproj, prefs, java, gitattributes, tpl, pug, ejs, project, classpath, scss, yml, styl, erb, ps1, sql, xhtml, vue, editorconfig, htaccess, asax, gradle, properties, go, bat, jshintrc, nuspec, toml, dockerignore, ru, npmignore, jscsrc, sfproj
  • 19 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (451 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (146 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (606 files).
    • exclude files with path like ".*/jquery([^.]*)\.validate(\.unobtrusive)?\.js" (jQuery validation plugin (MS bundles this with asp.net mvc)) (0 files).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 files).
    • exclude files with path like ".*/modernizr\-\d\.\d+(\.\d+)?\.js" (Modernizr) (27 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (34 files).
    • exclude files with path like ".*/angular([^.]*)\.js" (AngularJS) (8 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (78 files).
    • exclude files with path like ".*/normalize[.](css|less|scss|styl)" (Normalize css) (2 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/effects\.js" (Prototype) (0 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (4 files).
    • exclude files with path like ".*/cache/.*" (Caches) (0 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 ".*/bootstrap[-].*" (Library) (0 files).
    • exclude files with path like ".*[.]txt" (Text files) (116 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.

main94556 LOC (23%) 2407 files
test4974 LOC (1%) 197 files
generated133642 LOC (32%) 54 files
build and deployment3010 LOC (<1%) 76 files
other169109 LOC (41%) 1146 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cshtml
ejs
tpl
pug
styl
sfproj
asax
ru
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2407 files match defined criteria (94,556 lines of code, 100.0% vs. main code):
    • 622 *.js files (26,274 lines of code)
    • 169 *.css files (18,740 lines of code)
    • 146 *.less files (10,756 lines of code)
    • 255 *.cs files (8,631 lines of code)
    • 314 *.cshtml files (6,273 lines of code)
    • 238 *.php files (5,891 lines of code)
    • 138 *.yaml files (3,810 lines of code)
    • 94 *.html files (3,299 lines of code)
    • 100 *.py files (1,994 lines of code)
    • 16 *.ejs files (1,948 lines of code)
    • 45 *.tpl files (1,206 lines of code)
    • 40 *.java files (1,162 lines of code)
    • 10 *.ps1 files (1,151 lines of code)
    • 42 *.pug files (934 lines of code)
    • 10 *.xhtml files (582 lines of code)
    • 81 *.rb files (384 lines of code)
    • 14 *.styl files (350 lines of code)
    • 5 *.go files (240 lines of code)
    • 16 *.yml files (215 lines of code)
    • 12 *.erb files (213 lines of code)
    • 16 *.scss files (200 lines of code)
    • 8 *.vue files (168 lines of code)
    • 2 *.sfproj files (94 lines of code)
    • 4 *.toml files (28 lines of code)
    • 7 *.asax files (7 lines of code)
    • 3 *.ru files (6 lines of code)
  • " *.js" is biggest, containing 27.79% of code.
  • " *.ru" is smallest, containing 0.01% of code.


*.js26274 LOC (27%) 622 files
*.css18740 LOC (19%) 169 files
*.less10756 LOC (11%) 146 files
*.cs8631 LOC (9%) 255 files
*.cshtml6273 LOC (6%) 314 files
*.php5891 LOC (6%) 238 files
*.yaml3810 LOC (4%) 138 files
*.html3299 LOC (3%) 94 files
*.py1994 LOC (2%) 100 files
*.ejs1948 LOC (2%) 16 files
*.tpl1206 LOC (1%) 45 files
*.java1162 LOC (1%) 40 files
*.ps11151 LOC (1%) 10 files
*.pug934 LOC (<1%) 42 files
*.xhtml582 LOC (<1%) 10 files
*.rb384 LOC (<1%) 81 files
*.styl350 LOC (<1%) 14 files
*.go240 LOC (<1%) 5 files
*.yml215 LOC (<1%) 16 files
*.erb213 LOC (<1%) 12 files
*.scss200 LOC (<1%) 16 files
*.vue168 LOC (<1%) 8 files
*.sfproj94 LOC (<1%) 2 files
*.toml28 LOC (<1%) 4 files
*.asax7 LOC (<1%) 7 files
*.ru6 LOC (<1%) 3 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]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 197 files match defined criteria (4,974 lines of code, 5.3% vs. main code):
    • 58 *.js files (2,144 lines of code)
    • 31 *.cs files (773 lines of code)
    • 37 *.py files (729 lines of code)
    • 24 *.csproj files (551 lines of code)
    • 14 *.java files (345 lines of code)
    • 20 *.php files (210 lines of code)
    • 2 *.bat files (122 lines of code)
    • 2 *.gradle files (64 lines of code)
    • 9 *.rb files (36 lines of code)
  • " *.js" is biggest, containing 43.1% of code.
  • " *.rb" is smallest, containing 0.72% of code.


*.js2144 LOC (43%) 58 files
*.cs773 LOC (15%) 31 files
*.py729 LOC (14%) 37 files
*.csproj551 LOC (11%) 24 files
*.java345 LOC (6%) 14 files
*.php210 LOC (4%) 20 files
*.bat122 LOC (2%) 2 files
*.gradle64 LOC (1%) 2 files
*.rb36 LOC (<1%) 9 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 ".*/npm[-]shrinkwrap[.]json".
    • files with paths like ".*/package[-]lock[.]json".
  • 54 files match defined criteria (133,642 lines of code, 141.3% vs. main code). All matches are in *.json files.


*.json133642 LOC (100%) 54 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
nuspec
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 ".*[.]csproj".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 76 files match defined criteria (3,010 lines of code, 3.2% vs. main code):
    • 61 *.csproj files (2,717 lines of code)
    • 2 *.bat files (122 lines of code)
    • 4 *.nuspec files (112 lines of code)
    • 4 *.gradle files (44 lines of code)
    • 5 *.js files (15 lines of code)
  • " *.csproj" is biggest, containing 90.27% of code.
  • " *.js" is smallest, containing 0.5% of code.


*.csproj2717 LOC (90%) 61 files
*.bat122 LOC (4%) 2 files
*.nuspec112 LOC (3%) 4 files
*.gradle44 LOC (1%) 4 files
*.js15 LOC (<1%) 5 files
Other Code
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 ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]htaccess".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 1146 files match defined criteria (169,109 lines of code, 178.8% vs. main code):
    • 560 *.json files (160,586 lines of code)
    • 205 *.md files (4,532 lines of code)
    • 90 *.xml files (3,174 lines of code)
    • 279 *.svg files (741 lines of code)
    • 10 *.sql files (74 lines of code)
    • 2 *.properties files (2 lines of code)
  • " *.json" is biggest, containing 94.96% of code.
  • " *.properties" is smallest, containing 0% of code.


*.json160586 LOC (94%) 560 files
*.md4532 LOC (2%) 205 files
*.xml3174 LOC (1%) 90 files
*.svg741 LOC (<1%) 279 files
*.sql74 LOC (<1%) 10 files
*.properties2 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.less files are analyzed with LessAnalyzer:
    • 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)
  • *.cshtml 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
  • *.php files are analyzed with PhpAnalyzer:
    • 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
  • *.yaml 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
  • *.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
  • *.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
  • *.ejs 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
  • *.tpl 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
  • *.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)
  • *.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
  • *.pug 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
  • *.xhtml 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
  • *.rb files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.styl 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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.erb 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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.vue 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
  • *.sfproj 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
  • *.toml 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
  • *.asax 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
  • *.ru files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis


2022-01-30 15:43