azure / Microsoft-Defender-for-Cloud
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
workbook
txt
cmd
gitmodules
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.

main9813 LOC (10%) 108 files
test0 LOC (0%) 0 files
generated985 LOC (1%) 1 file
build and deployment0 LOC (0%) 0 files
other86892 LOC (88%) 651 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 ".*".
  • 108 files match defined criteria (9,813 LOC, 100.0% vs. main code):
    • 91 *.ps1 files (7,956 LOC)
    • 2 *.psm1 files (530 LOC)
    • 2 *.py files (373 LOC)
    • 2 *.yaml files (274 LOC)
    • 3 *.ts files (191 LOC)
    • 2 *.tf files (171 LOC)
    • 1 *.cs files (130 LOC)
    • 3 *.cmd files (96 LOC)
    • 2 *.psd1 files (92 LOC)
  • " *.ps1" is biggest, containing 81.08% of LOC.
  • " *.psd1" is smallest, containing 0.94% of LOC.


*.ps17956 LOC (81%) 91 files
*.psm1530 LOC (5%) 2 files
*.py373 LOC (3%) 2 files
*.yaml274 LOC (2%) 2 files
*.ts191 LOC (1%) 3 files
*.tf171 LOC (1%) 2 files
*.cs130 LOC (1%) 1 file
*.cmd96 LOC (<1%) 3 files
*.psd192 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 ".*/package[-]lock[.]json".
  • 1 file matches defined criteria (985 LOC, 10.0% vs. main code). All matches are in *.json files.


*.json985 LOC (100%) 1 file
Other Code
workbook
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 ".*[.]workbook".
    • files with paths like ".*[.]svg".
  • 651 files match defined criteria (86,892 LOC, 885.5% vs. main code):
    • 243 *.json files (72,306 LOC)
    • 402 *.md files (11,895 LOC)
    • 1 *.svg files (1,344 LOC)
    • 3 *.workbook files (1,341 LOC)
    • 2 *.txt files (6 LOC)
  • " *.json" is biggest, containing 83.21% of LOC.
  • " *.txt" is smallest, containing 0.01% of LOC.


*.json72306 LOC (83%) 243 files
*.md11895 LOC (13%) 402 files
*.svg1344 LOC (1%) 1 file
*.workbook1341 LOC (1%) 3 files
*.txt6 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-06 21:46