facebookresearch / aepsych
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
meta
asset
ini
shader
txt
tex
prefab
cginc
mat
bib
pyi
unity
plist
  • 22 extensions are included in analyses: meta, py, asset, cs, ini, shader, txt, tex, prefab, ipynb, md, XML, json, cginc, mat, bib, pyi, m, unity, plist, xml, yml
  • 4 criteria are used to exclude files from analysis:
    • 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) (8 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.

main36603 LOC (84%) 111 files
test2212 LOC (5%) 27 files
generated2510 LOC (5%) 109 files
build and deployment0 LOC (0%) 0 files
other2103 LOC (4%) 26 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
asset
shader
unity
prefab
cginc
mat
pyi
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 111 files match defined criteria (36,603 lines of code, 100.0% vs. main code):
    • 3 *.xml files (24,014 lines of code)
    • 45 *.py files (4,584 lines of code)
    • 22 *.asset files (2,707 lines of code)
    • 11 *.shader files (1,730 lines of code)
    • 16 *.cs files (1,153 lines of code)
    • 1 *.unity files (1,011 lines of code)
    • 6 *.prefab files (806 lines of code)
    • 3 *.cginc files (230 lines of code)
    • 2 *.mat files (210 lines of code)
    • 1 *.m files (115 lines of code)
    • 1 *.pyi files (43 lines of code)
  • " *.xml" is biggest, containing 65.61% of code.
  • " *.pyi" is smallest, containing 0.12% of code.


*.xml24014 LOC (65%) 3 files
*.py4584 LOC (12%) 45 files
*.asset2707 LOC (7%) 22 files
*.shader1730 LOC (4%) 11 files
*.cs1153 LOC (3%) 16 files
*.unity1011 LOC (2%) 1 files
*.prefab806 LOC (2%) 6 files
*.cginc230 LOC (<1%) 3 files
*.mat210 LOC (<1%) 2 files
*.m115 LOC (<1%) 1 files
*.pyi43 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 ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
  • 27 files match defined criteria (2,212 lines of code, 6.0% vs. main code). All matches are in *.py files.


*.py2212 LOC (100%) 27 files
Generated Code
Automatically generated files, not manually changed after generation.
meta
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]meta" AND any line of content like ".*fileFormatVersion[:] .*".
  • 109 files match defined criteria (2,510 lines of code, 6.9% vs. main code). All matches are in *.meta files.


*.meta2510 LOC (100%) 109 files
Other Code
ini
plist
meta
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 ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 26 files match defined criteria (2,103 lines of code, 5.7% vs. main code):
    • 3 *.ipynb files (810 lines of code)
    • 12 *.ini files (803 lines of code)
    • 5 *.md files (261 lines of code)
    • 2 *.json files (162 lines of code)
    • 1 *.plist files (46 lines of code)
    • 2 *.meta files (15 lines of code)
    • 1 *.xml files (6 lines of code)
  • " *.ipynb" is biggest, containing 38.52% of code.
  • " *.xml" is smallest, containing 0.29% of code.


*.ipynb810 LOC (38%) 3 files
*.ini803 LOC (38%) 12 files
*.md261 LOC (12%) 5 files
*.json162 LOC (7%) 2 files
*.plist46 LOC (2%) 1 files
*.meta15 LOC (<1%) 2 files
*.xml6 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.xml files are analyzed with XmlAnalyzer:
    • 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
  • *.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
  • *.asset 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
  • *.shader 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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 namespace heuristics)
  • *.unity 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
  • *.prefab 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
  • *.cginc 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
  • *.mat 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
  • *.m 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
  • *.pyi 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


2022-01-25 20:08