facebookresearch / Mephisto
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
babelrc
txt
gitattributes
cjs
mdx
jsonl
patch
dockerignore
npmrc
ini
in
toml
prettierignore
  • 27 extensions are included in analyses: py, js, md, json, jsx, css, svg, tsx, html, yml, yaml, babelrc, ts, sh, txt, gitattributes, gitignore, cjs, mdx, jsonl, patch, dockerignore, npmrc, ini, in, toml, prettierignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (35 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (75 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (1 file).
    • 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) (6 files).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (23 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.

main24954 LOC (7%) 264 files
test3839 LOC (1%) 41 files
generated145270 LOC (44%) 10 files
build and deployment374 LOC (<1%) 15 files
other148824 LOC (46%) 115 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
toml
in
jsonl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 264 files match defined criteria (24,954 lines of code, 100.0% vs. main code):
    • 135 *.py files (14,367 lines of code)
    • 68 *.js files (5,334 lines of code)
    • 17 *.css files (2,007 lines of code)
    • 12 *.jsx files (1,653 lines of code)
    • 14 *.tsx files (1,157 lines of code)
    • 8 *.ts files (250 lines of code)
    • 6 *.html files (125 lines of code)
    • 1 *.toml files (41 lines of code)
    • 1 *.in files (12 lines of code)
    • 1 *.yaml files (6 lines of code)
    • 1 *.jsonl files (2 lines of code)
  • " *.py" is biggest, containing 57.57% of code.
  • " *.jsonl" is smallest, containing 0.01% of code.


*.py14367 LOC (57%) 135 files
*.js5334 LOC (21%) 68 files
*.css2007 LOC (8%) 17 files
*.jsx1653 LOC (6%) 12 files
*.tsx1157 LOC (4%) 14 files
*.ts250 LOC (1%) 8 files
*.html125 LOC (<1%) 6 files
*.toml41 LOC (<1%) 1 files
*.in12 LOC (<1%) 1 files
*.yaml6 LOC (<1%) 1 files
*.jsonl2 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 ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
  • 41 files match defined criteria (3,839 lines of code, 15.4% vs. main code):
    • 29 *.py files (3,206 lines of code)
    • 10 *.js files (612 lines of code)
    • 2 *.jsonl files (21 lines of code)
  • " *.py" is biggest, containing 83.51% of code.
  • " *.jsonl" is smallest, containing 0.55% of code.


*.py3206 LOC (83%) 29 files
*.js612 LOC (15%) 10 files
*.jsonl21 LOC (<1%) 2 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".
  • 10 files match defined criteria (145,270 lines of code, 582.2% vs. main code). All matches are in *.json files.


*.json145270 LOC (100%) 10 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 ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 15 files match defined criteria (374 lines of code, 1.5% vs. main code):
    • 7 *.js files (272 lines of code)
    • 8 *.sh files (102 lines of code)
  • " *.js" is biggest, containing 72.73% of code.
  • " *.sh" is smallest, containing 27.27% of code.


*.js272 LOC (72%) 7 files
*.sh102 LOC (27%) 8 files
Other Code
patch
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*[.]mdx".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[Ee]xamples/.*".
  • 115 files match defined criteria (148,824 lines of code, 596.4% vs. main code):
    • 32 *.json files (146,008 lines of code)
    • 43 *.md files (1,416 lines of code)
    • 6 *.js files (421 lines of code)
    • 11 *.py files (332 lines of code)
    • 6 *.html files (293 lines of code)
    • 2 *.jsx files (143 lines of code)
    • 9 *.yaml files (121 lines of code)
    • 2 *.patch files (52 lines of code)
    • 2 *.svg files (30 lines of code)
    • 1 *.ini files (7 lines of code)
    • 1 *.css files (1 lines of code)
  • " *.json" is biggest, containing 98.11% of code.
  • " *.css" is smallest, containing 0% of code.


*.json146008 LOC (98%) 32 files
*.md1416 LOC (<1%) 43 files
*.js421 LOC (<1%) 6 files
*.py332 LOC (<1%) 11 files
*.html293 LOC (<1%) 6 files
*.jsx143 LOC (<1%) 2 files
*.yaml121 LOC (<1%) 9 files
*.patch52 LOC (<1%) 2 files
*.svg30 LOC (<1%) 2 files
*.ini7 LOC (<1%) 1 files
*.css1 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-25 19:44