facebookresearch / ParlAI
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
jsonl
babelrc
ini
toml
  • 17 extensions are included in analyses: py, yml, md, json, jsx, txt, html, yaml, jsonl, js, sh, css, babelrc, ini, svg, gitignore, toml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (53 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) (13 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.

main89390 LOC (31%) 1089 files
test178926 LOC (62%) 706 files
generated8332 LOC (2%) 1 files
build and deployment473 LOC (<1%) 13 files
other7754 LOC (2%) 227 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
jsonl
toml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1089 files match defined criteria (89,390 lines of code, 100.0% vs. main code):
    • 1,015 *.py files (82,507 lines of code)
    • 22 *.jsx files (3,299 lines of code)
    • 5 *.css files (1,808 lines of code)
    • 8 *.js files (803 lines of code)
    • 14 *.html files (562 lines of code)
    • 14 *.yaml files (320 lines of code)
    • 4 *.yml files (66 lines of code)
    • 6 *.jsonl files (13 lines of code)
    • 1 *.toml files (12 lines of code)
  • " *.py" is biggest, containing 92.3% of code.
  • " *.toml" is smallest, containing 0.01% of code.


*.py82507 LOC (92%) 1015 files
*.jsx3299 LOC (3%) 22 files
*.css1808 LOC (2%) 5 files
*.js803 LOC (<1%) 8 files
*.html562 LOC (<1%) 14 files
*.yaml320 LOC (<1%) 14 files
*.yml66 LOC (<1%) 4 files
*.jsonl13 LOC (<1%) 6 files
*.toml12 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
jsonl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
  • 706 files match defined criteria (178,926 lines of code, 200.2% vs. main code):
    • 587 *.yml files (164,169 lines of code)
    • 118 *.py files (14,756 lines of code)
    • 1 *.jsonl files (1 lines of code)
  • " *.yml" is biggest, containing 91.75% of code.
  • " *.jsonl" is smallest, containing 0% of code.


*.yml164169 LOC (91%) 587 files
*.py14756 LOC (8%) 118 files
*.jsonl1 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 ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
  • 1 file matches defined criteria (8,332 lines of code, 9.3% vs. main code). All matches are in *.html files.


*.html8332 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 ".*[.]sh".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 13 files match defined criteria (473 lines of code, 0.5% vs. main code):
    • 10 *.sh files (352 lines of code)
    • 3 *.js files (121 lines of code)
  • " *.sh" is biggest, containing 74.42% of code.
  • " *.js" is smallest, containing 25.58% of code.


*.sh352 LOC (74%) 10 files
*.js121 LOC (25%) 3 files
Other Code
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
  • 227 files match defined criteria (7,754 lines of code, 8.7% vs. main code):
    • 185 *.md files (4,290 lines of code)
    • 34 *.json files (3,180 lines of code)
    • 4 *.py files (233 lines of code)
    • 2 *.svg files (31 lines of code)
    • 2 *.ini files (20 lines of code)
  • " *.md" is biggest, containing 55.33% of code.
  • " *.ini" is smallest, containing 0.26% of code.


*.md4290 LOC (55%) 185 files
*.json3180 LOC (41%) 34 files
*.py233 LOC (3%) 4 files
*.svg31 LOC (<1%) 2 files
*.ini20 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.jsx 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
  • *.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
  • *.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
  • *.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
  • *.jsonl files are analyzed with JsonAnalyzer:
    • 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
  • *.toml 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


2022-01-25 19:31