microsoft / Azure-DCAP-Client
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
cmd
vcxproj
txt
nuspec
wixproj
in
clang-format
wxs
  • 19 extensions are included in analyses: cpp, h, yml, cmd, ps1, vcxproj, txt, MD, json, nuspec, gitignore, wixproj, xml, md, in, clang-format, groovy, wxs, Xml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (14 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.

main4182 LOC (73%) 36 files
test1427 LOC (24%) 6 files
generated0 LOC (0%) 0 files
build and deployment52 LOC (<1%) 2 files
other48 LOC (<1%) 2 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
cmd
wxs
wixproj
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 36 files match defined criteria (4,182 lines of code, 100.0% vs. main code):
    • 10 *.cpp files (3,314 lines of code)
    • 12 *.h files (336 lines of code)
    • 1 *.vcxproj files (116 lines of code)
    • 3 *.ps1 files (112 lines of code)
    • 2 *.md files (105 lines of code)
    • 4 *.cmd files (52 lines of code)
    • 1 *.wxs files (48 lines of code)
    • 1 *.wixproj files (45 lines of code)
    • 1 *.in files (40 lines of code)
    • 1 *.xml files (14 lines of code)
  • " *.cpp" is biggest, containing 79.24% of code.
  • " *.xml" is smallest, containing 0.33% of code.


*.cpp3314 LOC (79%) 10 files
*.h336 LOC (8%) 12 files
*.vcxproj116 LOC (2%) 1 files
*.ps1112 LOC (2%) 3 files
*.md105 LOC (2%) 2 files
*.cmd52 LOC (1%) 4 files
*.wxs48 LOC (1%) 1 files
*.wixproj45 LOC (1%) 1 files
*.in40 LOC (<1%) 1 files
*.xml14 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
vcxproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/UnitTests?/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 6 files match defined criteria (1,427 lines of code, 34.1% vs. main code):
    • 4 *.cpp files (1,103 lines of code)
    • 2 *.vcxproj files (324 lines of code)
  • " *.cpp" is biggest, containing 77.3% of code.
  • " *.vcxproj" is smallest, containing 22.7% of code.


*.cpp1103 LOC (77%) 4 files
*.vcxproj324 LOC (22%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*[.]nuspec".
  • 2 files match defined criteria (52 lines of code, 1.2% vs. main code). All matches are in *.nuspec files.


*.nuspec52 LOC (100%) 2 files
Other Code
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 ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 2 files match defined criteria (48 lines of code, 1.1% vs. main code):
    • 1 *.md files (44 lines of code)
    • 1 *.xml files (4 lines of code)
  • " *.md" is biggest, containing 91.67% of code.
  • " *.xml" is smallest, containing 8.33% of code.


*.md44 LOC (91%) 1 files
*.xml4 LOC (8%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.vcxproj 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
  • *.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
  • *.md 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
  • *.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
  • *.wxs 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
  • *.wixproj 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
  • *.in 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
  • *.xml 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


2022-01-30 22:09