dart-lang / sdk
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
gni
txt
gn
S
proto
patch
tex
clang-format
cmake
in
clang-tidy
gitattributes
TXT
gitconfig
cfg
g
properties
  • 38 extensions are included in analyses: dart, cc, yaml, h, md, html, java, py, json, gni, txt, gitignore, sh, gn, js, svg, bat, S, css, yml, proto, c, scss, patch, tex, clang-format, cmake, xml, mm, in, clang-tidy, gitattributes, TXT, gitconfig, cfg, g, dockerfile, properties
  • 11 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (43 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (98 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (337 files).
    • exclude files with path like ".*/target/.*" (Compiled files) (8 files).
    • exclude files with path like ".*/d3(\.v\d+)?([^.]*)\.js" (D3) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (70 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 ".*[.]txt" (Text files) (52 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*/(vuejs|js/lib)/.*" (3 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.

main1770449 LOC (45%) 7643 files
test1978164 LOC (50%) 18699 files
generated80438 LOC (2%) 201 files
build and deployment1795 LOC (<1%) 41 files
other86189 LOC (2%) 272 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
gn
gni
g
in
proto
s
cmake
txt
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 7643 files match defined criteria (1,770,449 lines of code, 100.0% vs. main code):
    • 6,074 *.dart files (1,307,327 lines of code)
    • 348 *.cc files (276,281 lines of code)
    • 319 *.h files (95,375 lines of code)
    • 487 *.yaml files (34,741 lines of code)
    • 117 *.py files (21,711 lines of code)
    • 119 *.html files (10,160 lines of code)
    • 8 *.css files (6,617 lines of code)
    • 15 *.js files (5,215 lines of code)
    • 37 *.gn files (4,338 lines of code)
    • 66 *.gni files (4,029 lines of code)
    • 1 *.g files (1,563 lines of code)
    • 38 *.java files (1,095 lines of code)
    • 2 *.scss files (1,023 lines of code)
    • 1 *.in files (407 lines of code)
    • 3 *.c files (256 lines of code)
    • 3 *.proto files (238 lines of code)
    • 1 *.s files (38 lines of code)
    • 2 *.cmake files (28 lines of code)
    • 1 *.txt files (5 lines of code)
    • 1 *.cfg files (2 lines of code)
  • " *.dart" is biggest, containing 73.84% of code.
  • " *.cfg" is smallest, containing 0% of code.


*.dart1307327 LOC (73%) 6074 files
*.cc276281 LOC (15%) 348 files
*.h95375 LOC (5%) 319 files
*.yaml34741 LOC (1%) 487 files
*.py21711 LOC (1%) 117 files
*.html10160 LOC (<1%) 119 files
*.css6617 LOC (<1%) 8 files
*.js5215 LOC (<1%) 15 files
*.gn4338 LOC (<1%) 37 files
*.gni4029 LOC (<1%) 66 files
*.g1563 LOC (<1%) 1 files
*.java1095 LOC (<1%) 38 files
*.scss1023 LOC (<1%) 2 files
*.in407 LOC (<1%) 1 files
*.c256 LOC (<1%) 3 files
*.proto238 LOC (<1%) 3 files
*.s38 LOC (<1%) 1 files
*.cmake28 LOC (<1%) 2 files
*.txt5 LOC (<1%) 1 files
*.cfg2 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]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 18699 files match defined criteria (1,978,164 lines of code, 111.7% vs. main code):
    • 18,420 *.dart files (1,903,693 lines of code)
    • 125 *.cc files (69,873 lines of code)
    • 10 *.py files (1,305 lines of code)
    • 6 *.java files (868 lines of code)
    • 35 *.html files (785 lines of code)
    • 5 *.h files (778 lines of code)
    • 83 *.yaml files (329 lines of code)
    • 8 *.js files (272 lines of code)
    • 7 *.sh files (261 lines of code)
  • " *.dart" is biggest, containing 96.24% of code.
  • " *.sh" is smallest, containing 0.01% of code.


*.dart1903693 LOC (96%) 18420 files
*.cc69873 LOC (3%) 125 files
*.py1305 LOC (<1%) 10 files
*.java868 LOC (<1%) 6 files
*.html785 LOC (<1%) 35 files
*.h778 LOC (<1%) 5 files
*.yaml329 LOC (<1%) 83 files
*.js272 LOC (<1%) 8 files
*.sh261 LOC (<1%) 7 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 ".*/generated/.*".
  • 201 files match defined criteria (80,438 lines of code, 4.5% vs. main code):
    • 97 *.dart files (71,389 lines of code)
    • 104 *.java files (9,049 lines of code)
  • " *.dart" is biggest, containing 88.75% of code.
  • " *.java" is smallest, containing 11.25% of code.


*.dart71389 LOC (88%) 97 files
*.java9049 LOC (11%) 104 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/build[.]xml".
    • files with paths like ".*[.]dockerfile".
    • files with paths like ".*/[.]gitconfig".
    • files with paths like ".*/[.]gitattributes".
  • 41 files match defined criteria (1,795 lines of code, 0.1% vs. main code):
    • 38 *.sh files (1,761 lines of code)
    • 2 *.bat files (23 lines of code)
    • 1 *.dockerfile files (11 lines of code)
  • " *.sh" is biggest, containing 98.11% of code.
  • " *.dockerfile" is smallest, containing 0.61% of code.


*.sh1761 LOC (98%) 38 files
*.bat23 LOC (1%) 2 files
*.dockerfile11 LOC (<1%) 1 files
Other Code
patch
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 272 files match defined criteria (86,189 lines of code, 4.9% vs. main code):
    • 64 *.json files (50,398 lines of code)
    • 169 *.md files (33,802 lines of code)
    • 30 *.dart files (1,865 lines of code)
    • 5 *.svg files (45 lines of code)
    • 1 *.xml files (43 lines of code)
    • 1 *.patch files (24 lines of code)
    • 1 *.yaml files (11 lines of code)
    • 1 *.properties files (1 lines of code)
  • " *.json" is biggest, containing 58.47% of code.
  • " *.properties" is smallest, containing 0% of code.


*.json50398 LOC (58%) 64 files
*.md33802 LOC (39%) 169 files
*.dart1865 LOC (2%) 30 files
*.svg45 LOC (<1%) 5 files
*.xml43 LOC (<1%) 1 files
*.patch24 LOC (<1%) 1 files
*.yaml11 LOC (<1%) 1 files
*.properties1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.dart 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
  • *.cc 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
  • *.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
  • *.py files are analyzed with PythonAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.gn files are analyzed with PythonAnalyzer:
    • 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
  • *.gni 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
  • *.g 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
  • *.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)
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.proto 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
  • *.s 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
  • *.cmake 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
  • *.txt 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


2022-02-03 02:28