facebookincubator / ktfmt
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
properties
txt
gitmodules
  • 17 extensions are included in analyses: kt, java, md, css, kts, properties, xml, json, js, txt, bat, yaml, gitignore, sh, yml, html, gitmodules
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (2 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).
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.

main10869 LOC (29%) 45 files
test6691 LOC (18%) 12 files
generated9269 LOC (25%) 1 files
build and deployment478 LOC (1%) 5 files
other9574 LOC (25%) 14 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 45 files match defined criteria (10,869 lines of code, 100.0% vs. main code):
    • 3 *.css files (6,153 lines of code)
    • 25 *.kt files (3,423 lines of code)
    • 8 *.java files (623 lines of code)
    • 1 *.html files (291 lines of code)
    • 2 *.js files (248 lines of code)
    • 4 *.kts files (80 lines of code)
    • 1 *.yaml files (29 lines of code)
    • 1 *.xml files (22 lines of code)
  • " *.css" is biggest, containing 56.61% of code.
  • " *.xml" is smallest, containing 0.2% of code.


*.css6153 LOC (56%) 3 files
*.kt3423 LOC (31%) 25 files
*.java623 LOC (5%) 8 files
*.html291 LOC (2%) 1 files
*.js248 LOC (2%) 2 files
*.kts80 LOC (<1%) 4 files
*.yaml29 LOC (<1%) 1 files
*.xml22 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]est/.*".
    • files with paths like ".*_test[.].*".
  • 12 files match defined criteria (6,691 lines of code, 61.6% vs. main code):
    • 11 *.kt files (6,676 lines of code)
    • 1 *.java files (15 lines of code)
  • " *.kt" is biggest, containing 99.78% of code.
  • " *.java" is smallest, containing 0.22% of code.


*.kt6676 LOC (99%) 11 files
*.java15 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 ".*/package[-]lock[.]json".
  • 1 file matches defined criteria (9,269 lines of code, 85.3% vs. main code). All matches are in *.json files.


*.json9269 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 5 files match defined criteria (478 lines of code, 4.4% vs. main code):
    • 2 *.xml files (324 lines of code)
    • 2 *.bat files (146 lines of code)
    • 1 *.sh files (8 lines of code)
  • " *.xml" is biggest, containing 67.78% of code.
  • " *.sh" is smallest, containing 1.67% of code.


*.xml324 LOC (67%) 2 files
*.bat146 LOC (30%) 2 files
*.sh8 LOC (1%) 1 files
Other Code
properties
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
  • 14 files match defined criteria (9,574 lines of code, 88.1% vs. main code):
    • 3 *.json files (9,356 lines of code)
    • 8 *.md files (215 lines of code)
    • 2 *.properties files (2 lines of code)
    • 1 *.txt files (1 lines of code)
  • " *.json" is biggest, containing 97.72% of code.
  • " *.txt" is smallest, containing 0.01% of code.


*.json9356 LOC (97%) 3 files
*.md215 LOC (2%) 8 files
*.properties2 LOC (<1%) 2 files
*.txt1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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)
  • *.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)
  • *.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
  • *.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
  • *.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)
  • *.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
  • *.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-04-15 05:03