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

main46674 LOC (51%) 352 files
test345 LOC (<1%) 8 files
generated20192 LOC (22%) 1 files
build and deployment462 LOC (<1%) 5 files
other22111 LOC (24%) 75 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
toml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 352 files match defined criteria (46,674 lines of code, 100.0% vs. main code):
    • 211 *.py files (22,794 lines of code)
    • 101 *.js files (20,155 lines of code)
    • 13 *.jsx files (2,735 lines of code)
    • 18 *.css files (776 lines of code)
    • 5 *.yaml files (75 lines of code)
    • 2 *.html files (57 lines of code)
    • 1 *.dockerfile files (47 lines of code)
    • 1 *.toml files (35 lines of code)
  • " *.py" is biggest, containing 48.84% of code.
  • " *.toml" is smallest, containing 0.07% of code.


*.py22794 LOC (48%) 211 files
*.js20155 LOC (43%) 101 files
*.jsx2735 LOC (5%) 13 files
*.css776 LOC (1%) 18 files
*.yaml75 LOC (<1%) 5 files
*.html57 LOC (<1%) 2 files
*.dockerfile47 LOC (<1%) 1 files
*.toml35 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[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
  • 8 files match defined criteria (345 lines of code, 0.7% vs. main code):
    • 7 *.py files (339 lines of code)
    • 1 *.js files (6 lines of code)
  • " *.py" is biggest, containing 98.26% of code.
  • " *.js" is smallest, containing 1.74% of code.


*.py339 LOC (98%) 7 files
*.js6 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 (20,192 lines of code, 43.3% vs. main code). All matches are in *.json files.


*.json20192 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 5 files match defined criteria (462 lines of code, 1.0% vs. main code):
    • 4 *.sh files (406 lines of code)
    • 1 *.js files (56 lines of code)
  • " *.sh" is biggest, containing 87.88% of code.
  • " *.js" is smallest, containing 12.12% of code.


*.sh406 LOC (87%) 4 files
*.js56 LOC (12%) 1 files
Other Code
properties
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 75 files match defined criteria (22,111 lines of code, 47.4% vs. main code):
    • 59 *.json files (20,818 lines of code)
    • 3 *.ipynb files (636 lines of code)
    • 2 *.js files (451 lines of code)
    • 8 *.md files (183 lines of code)
    • 2 *.properties files (18 lines of code)
    • 1 *.ini files (5 lines of code)
  • " *.json" is biggest, containing 94.15% of code.
  • " *.ini" is smallest, containing 0.02% of code.


*.json20818 LOC (94%) 59 files
*.ipynb636 LOC (2%) 3 files
*.js451 LOC (2%) 2 files
*.md183 LOC (<1%) 8 files
*.properties18 LOC (<1%) 2 files
*.ini5 LOC (<1%) 1 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
  • *.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
  • *.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
  • *.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
  • *.dockerfile 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
  • *.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:51