microsoft / azure-pipelines-tasks
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
cmd
gitattributes
csproj
  • 21 extensions are included in analyses: ts, json, ps1, svg, txt, md, xml, js, psm1, html, yml, java, sh, gradle, yaml, css, gitignore, cmd, gitattributes, sql, csproj
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (10 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (200 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (22 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) (127 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.

main135295 LOC (22%) 1174 files
test112489 LOC (18%) 1759 files
generated120414 LOC (19%) 261 files
build and deployment1239 LOC (<1%) 17 files
other235261 LOC (38%) 1710 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1174 files match defined criteria (135,295 lines of code, 100.0% vs. main code):
    • 874 *.ts files (95,550 lines of code)
    • 231 *.ps1 files (33,133 lines of code)
    • 33 *.js files (3,270 lines of code)
    • 24 *.psm1 files (2,542 lines of code)
    • 8 *.yml files (760 lines of code)
    • 4 *.cmd files (40 lines of code)
  • " *.ts" is biggest, containing 70.62% of code.
  • " *.cmd" is smallest, containing 0.03% of code.


*.ts95550 LOC (70%) 874 files
*.ps133133 LOC (24%) 231 files
*.js3270 LOC (2%) 33 files
*.psm12542 LOC (1%) 24 files
*.yml760 LOC (<1%) 8 files
*.cmd40 LOC (<1%) 4 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 ".*/UnitTests?/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 1759 files match defined criteria (112,489 lines of code, 83.1% vs. main code):
    • 1,155 *.ts files (90,329 lines of code)
    • 523 *.ps1 files (16,968 lines of code)
    • 35 *.js files (2,403 lines of code)
    • 24 *.html files (2,020 lines of code)
    • 4 *.css files (428 lines of code)
    • 6 *.yaml files (160 lines of code)
    • 10 *.java files (152 lines of code)
    • 1 *.psm1 files (16 lines of code)
    • 1 *.csproj files (13 lines of code)
  • " *.ts" is biggest, containing 80.3% of code.
  • " *.csproj" is smallest, containing 0.01% of code.


*.ts90329 LOC (80%) 1155 files
*.ps116968 LOC (15%) 523 files
*.js2403 LOC (2%) 35 files
*.html2020 LOC (1%) 24 files
*.css428 LOC (<1%) 4 files
*.yaml160 LOC (<1%) 6 files
*.java152 LOC (<1%) 10 files
*.psm116 LOC (<1%) 1 files
*.csproj13 LOC (<1%) 1 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 ".*/package[-]lock[.]json".
    • files with paths like ".*/npm[-]shrinkwrap[.]json".
  • 261 files match defined criteria (120,414 lines of code, 89.0% vs. main code). All matches are in *.json files.


*.json120414 LOC (100%) 261 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]gradle".
  • 17 files match defined criteria (1,239 lines of code, 0.9% vs. main code):
    • 10 *.sh files (1,116 lines of code)
    • 7 *.gradle files (123 lines of code)
  • " *.sh" is biggest, containing 90.07% of code.
  • " *.gradle" is smallest, containing 9.93% of code.


*.sh1116 LOC (90%) 10 files
*.gradle123 LOC (9%) 7 files
Other Code
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 ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 1710 files match defined criteria (235,261 lines of code, 173.9% vs. main code):
    • 1,428 *.json files (228,361 lines of code)
    • 75 *.md files (3,038 lines of code)
    • 81 *.xml files (1,884 lines of code)
    • 125 *.svg files (1,775 lines of code)
    • 1 *.sql files (203 lines of code)
  • " *.json" is biggest, containing 97.07% of code.
  • " *.sql" is smallest, containing 0.09% of code.


*.json228361 LOC (97%) 1428 files
*.md3038 LOC (1%) 75 files
*.xml1884 LOC (<1%) 81 files
*.svg1775 LOC (<1%) 125 files
*.sql203 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.psm1 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
  • *.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
  • *.cmd 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


2022-01-30 09:27