microsoft / ApplicationInsights-Java
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
properties
gitattributes
editorconfig
nuspec
regex
proto
gitmodules
  • 27 extensions are included in analyses: java, xml, kts, txt, json, md, gradle, jsp, sh, cmd, ps1, yml, properties, dockerfile, yaml, gitignore, h, gitattributes, psm1, bat, editorconfig, nuspec, cpp, kt, regex, proto, gitmodules
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (34 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (1 file).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • 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) (52 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.

main23902 LOC (49%) 303 files
test19904 LOC (40%) 367 files
generated12 LOC (<1%) 1 files
build and deployment765 LOC (1%) 10 files
other4160 LOC (8%) 136 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
regex
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 303 files match defined criteria (23,902 lines of code, 100.0% vs. main code):
    • 281 *.java files (22,715 lines of code)
    • 17 *.kts files (781 lines of code)
    • 1 *.cpp files (337 lines of code)
    • 2 *.h files (45 lines of code)
    • 1 *.regex files (15 lines of code)
    • 1 *.kt files (9 lines of code)
  • " *.java" is biggest, containing 95.03% of code.
  • " *.kt" is smallest, containing 0.04% of code.


*.java22715 LOC (95%) 281 files
*.kts781 LOC (3%) 17 files
*.cpp337 LOC (1%) 1 files
*.h45 LOC (<1%) 2 files
*.regex15 LOC (<1%) 1 files
*.kt9 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 367 files match defined criteria (19,904 lines of code, 83.3% vs. main code):
    • 282 *.java files (18,779 lines of code)
    • 51 *.kts files (475 lines of code)
    • 8 *.gradle files (241 lines of code)
    • 12 *.jsp files (179 lines of code)
    • 8 *.sh files (105 lines of code)
    • 4 *.dockerfile files (98 lines of code)
    • 1 *.proto files (14 lines of code)
    • 1 *.yaml files (13 lines of code)
  • " *.java" is biggest, containing 94.35% of code.
  • " *.yaml" is smallest, containing 0.07% of code.


*.java18779 LOC (94%) 282 files
*.kts475 LOC (2%) 51 files
*.gradle241 LOC (1%) 8 files
*.jsp179 LOC (<1%) 12 files
*.sh105 LOC (<1%) 8 files
*.dockerfile98 LOC (<1%) 4 files
*.proto14 LOC (<1%) 1 files
*.yaml13 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 ".*[.]h" AND any line of content like ".* DO NOT EDIT THIS FILE [-] it is machine generated .*".
  • 1 file matches defined criteria (12 lines of code, 0.1% vs. main code). All matches are in *.h files.


*.h12 LOC (100%) 1 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]dockerfile".
    • files with paths like ".*[.]sh".
  • 10 files match defined criteria (765 lines of code, 3.2% vs. main code):
    • 8 *.gradle files (669 lines of code)
    • 1 *.bat files (68 lines of code)
    • 1 *.nuspec files (28 lines of code)
  • " *.gradle" is biggest, containing 87.45% of code.
  • " *.nuspec" is smallest, containing 3.66% of code.


*.gradle669 LOC (87%) 8 files
*.bat68 LOC (8%) 1 files
*.nuspec28 LOC (3%) 1 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 136 files match defined criteria (4,160 lines of code, 17.4% vs. main code):
    • 43 *.json files (1,834 lines of code)
    • 77 *.xml files (1,462 lines of code)
    • 12 *.md files (847 lines of code)
    • 4 *.properties files (17 lines of code)
  • " *.json" is biggest, containing 44.09% of code.
  • " *.properties" is smallest, containing 0.41% of code.


*.json1834 LOC (44%) 43 files
*.xml1462 LOC (35%) 77 files
*.md847 LOC (20%) 12 files
*.properties17 LOC (<1%) 4 files
Analyzers
Info about analyzers used for source code examinations.
  • *.java files are analyzed with JavaAnalyzer:
    • 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 package names)
  • *.kts files are analyzed with KotlinAnalyzer:
    • 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
    • Basic heuristic dependency analysis (based on imports and package statements)
  • *.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
  • *.regex 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
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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
    • Basic heuristic dependency analysis (based on imports and package statements)


2022-01-30 09:26