microsoft / pxt-calliope
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
resx
txt
gitattributes
jsproj
plist
clang-format
s
csproj
  • 27 extensions are included in analyses: md, ts, svg, json, cpp, cs, h, yml, js, gitignore, m, resx, sh, html, less, txt, css, tsx, gitattributes, jsproj, xib, plist, xml, c, clang-format, s, csproj
  • 10 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (4 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (349 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (11 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (4 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) (2 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.

main11415 LOC (34%) 102 files
test3346 LOC (10%) 17 files
generated5608 LOC (16%) 2 files
build and deployment130 LOC (<1%) 3 files
other12907 LOC (38%) 115 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
jsproj
s
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 102 files match defined criteria (11,415 lines of code, 100.0% vs. main code):
    • 50 *.ts files (5,523 lines of code)
    • 3 *.js files (2,940 lines of code)
    • 15 *.cpp files (1,416 lines of code)
    • 12 *.cs files (639 lines of code)
    • 4 *.m files (218 lines of code)
    • 2 *.tsx files (161 lines of code)
    • 3 *.less files (147 lines of code)
    • 7 *.h files (140 lines of code)
    • 1 *.jsproj files (82 lines of code)
    • 3 *.html files (75 lines of code)
    • 1 *.s files (38 lines of code)
    • 1 *.css files (36 lines of code)
  • " *.ts" is biggest, containing 48.38% of code.
  • " *.css" is smallest, containing 0.32% of code.


*.ts5523 LOC (48%) 50 files
*.js2940 LOC (25%) 3 files
*.cpp1416 LOC (12%) 15 files
*.cs639 LOC (5%) 12 files
*.m218 LOC (1%) 4 files
*.tsx161 LOC (1%) 2 files
*.less147 LOC (1%) 3 files
*.h140 LOC (1%) 7 files
*.jsproj82 LOC (<1%) 1 files
*.html75 LOC (<1%) 3 files
*.s38 LOC (<1%) 1 files
*.css36 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 ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 17 files match defined criteria (3,346 lines of code, 29.3% vs. main code). All matches are in *.ts files.


*.ts3346 LOC (100%) 17 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 "[/][/][ ]*".
    • files with paths like ".*/package[-]lock[.]json".
  • 2 files match defined criteria (5,608 lines of code, 49.1% vs. main code):
    • 1 *.json files (5,558 lines of code)
    • 1 *.cs files (50 lines of code)
  • " *.json" is biggest, containing 99.11% of code.
  • " *.cs" is smallest, containing 0.89% of code.


*.json5558 LOC (99%) 1 files
*.cs50 LOC (<1%) 1 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 ".*[.]sh".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 3 files match defined criteria (130 lines of code, 1.1% vs. main code):
    • 1 *.csproj files (116 lines of code)
    • 2 *.sh files (14 lines of code)
  • " *.csproj" is biggest, containing 89.23% of code.
  • " *.sh" is smallest, containing 10.77% of code.


*.csproj116 LOC (89%) 1 files
*.sh14 LOC (10%) 2 files
Other Code
plist
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 ".*[.]xib".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 115 files match defined criteria (12,907 lines of code, 113.1% vs. main code):
    • 58 *.json files (9,496 lines of code)
    • 45 *.svg files (3,192 lines of code)
    • 10 *.md files (165 lines of code)
    • 1 *.plist files (36 lines of code)
    • 1 *.xib files (18 lines of code)
  • " *.json" is biggest, containing 73.57% of code.
  • " *.xib" is smallest, containing 0.14% of code.


*.json9496 LOC (73%) 58 files
*.svg3192 LOC (24%) 45 files
*.md165 LOC (1%) 10 files
*.plist36 LOC (<1%) 1 files
*.xib18 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
  • *.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
  • *.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)
  • *.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
  • *.tsx 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
  • *.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
  • *.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
  • *.jsproj 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
  • *.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
  • *.s 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
  • *.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


2022-01-30 13:59