reactjs / ru.reactjs.org
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
eslintignore
babelrc
prettierignore
  • 15 extensions are included in analyses: md, js, tsx, json, svg, yml, css, ts, txt, html, gitignore, eslintignore, babelrc, prettierignore, yaml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (95 files).
    • exclude files with path like ".*/react(-[^.]*)?\.js" (React) (4 files).
    • exclude files with path like ".*/flow-typed/.*\.js" (flow-typed) (5 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.

main13133 LOC (19%) 233 files
test0 LOC (0%) 0 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other53081 LOC (80%) 442 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 ".*".
  • 233 files match defined criteria (13,133 lines of code, 100.0% vs. main code):
    • 118 *.js files (5,849 lines of code)
    • 92 *.tsx files (4,642 lines of code)
    • 8 *.yml files (1,686 lines of code)
    • 6 *.css files (657 lines of code)
    • 5 *.ts files (163 lines of code)
    • 1 *.yaml files (85 lines of code)
    • 3 *.html files (51 lines of code)
  • " *.js" is biggest, containing 44.54% of code.
  • " *.html" is smallest, containing 0.39% of code.


*.js5849 LOC (44%) 118 files
*.tsx4642 LOC (35%) 92 files
*.yml1686 LOC (12%) 8 files
*.css657 LOC (5%) 6 files
*.ts163 LOC (1%) 5 files
*.yaml85 LOC (<1%) 1 files
*.html51 LOC (<1%) 3 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[Ee]xamples/.*".
  • 442 files match defined criteria (53,081 lines of code, 404.2% vs. main code):
    • 347 *.md files (50,301 lines of code)
    • 20 *.json files (1,455 lines of code)
    • 65 *.js files (1,245 lines of code)
    • 7 *.svg files (72 lines of code)
    • 3 *.txt files (8 lines of code)
  • " *.md" is biggest, containing 94.76% of code.
  • " *.txt" is smallest, containing 0.02% of code.


*.md50301 LOC (94%) 347 files
*.json1455 LOC (2%) 20 files
*.js1245 LOC (2%) 65 files
*.svg72 LOC (<1%) 7 files
*.txt8 LOC (<1%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.yml 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
  • *.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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.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


2022-04-16 07:10