facebookresearch / CodeGen
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
profile
  • 12 extensions are included in analyses: py, java, cpp, sh, md, txt, json, jsonl, profile, yml, html, perl
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (4 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (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).
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.

main94368 LOC (93%) 2111 files
test4970 LOC (4%) 62 files
generated0 LOC (0%) 0 files
build and deployment506 LOC (<1%) 15 files
other817 LOC (<1%) 12 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
jsonl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2111 files match defined criteria (94,368 lines of code, 100.0% vs. main code):
    • 691 *.java files (35,533 lines of code)
    • 731 *.py files (34,189 lines of code)
    • 685 *.cpp files (23,943 lines of code)
    • 1 *.html files (554 lines of code)
    • 1 *.perl files (139 lines of code)
    • 2 *.jsonl files (10 lines of code)
  • " *.java" is biggest, containing 37.65% of code.
  • " *.jsonl" is smallest, containing 0.01% of code.


*.java35533 LOC (37%) 691 files
*.py34189 LOC (36%) 731 files
*.cpp23943 LOC (25%) 685 files
*.html554 LOC (<1%) 1 files
*.perl139 LOC (<1%) 1 files
*.jsonl10 LOC (<1%) 2 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 ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
  • 62 files match defined criteria (4,970 lines of code, 5.3% vs. main code):
    • 45 *.py files (4,464 lines of code)
    • 8 *.cpp files (234 lines of code)
    • 8 *.java files (212 lines of code)
    • 1 *.sh files (60 lines of code)
  • " *.py" is biggest, containing 89.82% of code.
  • " *.sh" is smallest, containing 1.21% of code.


*.py4464 LOC (89%) 45 files
*.cpp234 LOC (4%) 8 files
*.java212 LOC (4%) 8 files
*.sh60 LOC (1%) 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".
  • 15 files match defined criteria (506 lines of code, 0.5% vs. main code). All matches are in *.sh files.


*.sh506 LOC (100%) 15 files
Other Code
profile
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 12 files match defined criteria (817 lines of code, 0.9% vs. main code):
    • 11 *.md files (760 lines of code)
    • 1 *.profile files (57 lines of code)
  • " *.md" is biggest, containing 93.02% of code.
  • " *.profile" is smallest, containing 6.98% of code.


*.md760 LOC (93%) 11 files
*.profile57 LOC (6%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.cpp 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
  • *.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
  • *.perl files are analyzed with PerlAnalyzer:
    • 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
  • *.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 20:17