azure / iotedge
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
csproj
txt
spec
props
dotsettings
editorconfig
gitattributes
cfg
gv
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.

main113526 LOC (33%) 1,379 files
test90530 LOC (26%) 776 files
generated16530 LOC (4%) 17 files
build and deployment7317 LOC (2%) 72 files
other114676 LOC (33%) 196 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
spec
cfg
gv
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1379 files match defined criteria (113,526 LOC, 100.0% vs. main code):
    • 986 *.cs files (66,627 LOC)
    • 163 *.rs files (22,192 LOC)
    • 46 *.yaml files (19,261 LOC)
    • 171 *.toml files (3,920 LOC)
    • 3 *.ps1 files (908 LOC)
    • 2 *.spec files (324 LOC)
    • 4 *.g4 files (216 LOC)
    • 1 *.cfg files (34 LOC)
    • 1 *.gv files (30 LOC)
    • 2 *.props files (14 LOC)
  • " *.cs" is biggest, containing 58.69% of LOC.
  • " *.props" is smallest, containing 0.01% of LOC.


*.cs66627 LOC (58%) 986 files
*.rs22192 LOC (19%) 163 files
*.yaml19261 LOC (16%) 46 files
*.toml3920 LOC (3%) 171 files
*.ps1908 LOC (<1%) 3 files
*.spec324 LOC (<1%) 2 files
*.g4216 LOC (<1%) 4 files
*.cfg34 LOC (<1%) 1 file
*.gv30 LOC (<1%) 1 file
*.props14 LOC (<1%) 2 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]est[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*/test_.*".
  • 776 files match defined criteria (90,530 LOC, 79.7% vs. main code):
    • 678 *.cs files (83,214 LOC)
    • 33 *.yaml files (3,345 LOC)
    • 14 *.rs files (2,233 LOC)
    • 40 *.csproj files (1,461 LOC)
    • 5 *.sh files (156 LOC)
    • 4 *.ps1 files (86 LOC)
    • 2 *.toml files (35 LOC)
  • " *.cs" is biggest, containing 91.92% of LOC.
  • " *.toml" is smallest, containing 0.04% of LOC.


*.cs83214 LOC (91%) 678 files
*.yaml3345 LOC (3%) 33 files
*.rs2233 LOC (2%) 14 files
*.csproj1461 LOC (1%) 40 files
*.sh156 LOC (<1%) 5 files
*.ps186 LOC (<1%) 4 files
*.toml35 LOC (<1%) 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 "[/][/][ ]*".
  • 17 files match defined criteria (16,530 LOC, 14.6% vs. main code). All matches are in *.cs files.


*.cs16530 LOC (100%) 17 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 ".*[.]csproj".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 72 files match defined criteria (7,317 LOC, 6.4% vs. main code):
    • 47 *.sh files (6,540 LOC)
    • 25 *.csproj files (777 LOC)
  • " *.sh" is biggest, containing 89.38% of LOC.
  • " *.csproj" is smallest, containing 10.62% of LOC.


*.sh6540 LOC (89%) 47 files
*.csproj777 LOC (10%) 25 files
Other Code
csproj
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]editorconfig".
  • 196 files match defined criteria (114,676 LOC, 101.0% vs. main code):
    • 121 *.json files (108,558 LOC)
    • 60 *.md files (5,193 LOC)
    • 4 *.cs files (492 LOC)
    • 5 *.rs files (340 LOC)
    • 3 *.csproj files (71 LOC)
    • 3 *.txt files (22 LOC)
  • " *.json" is biggest, containing 94.66% of LOC.
  • " *.txt" is smallest, containing 0.02% of LOC.


*.json108558 LOC (94%) 121 files
*.md5193 LOC (4%) 60 files
*.cs492 LOC (<1%) 4 files
*.rs340 LOC (<1%) 5 files
*.csproj71 LOC (<1%) 3 files
*.txt22 LOC (<1%) 3 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)
  • *.rs files are analyzed with RustAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.spec 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
  • *.g4 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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.gv 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


2025-05-06 21:33