facebookresearch / RealityMaterialExplorer
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
mat
prefab
unity
shader
cginc
asset
txt
obj
plist
properties
mtl
pb
anim
  • 22 extensions are included in analyses: meta, cs, mat, prefab, unity, shader, cginc, asset, xml, txt, md, json, gradle, obj, plist, java, gitignore, properties, mtl, svg, pb, anim
  • 8 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) (2 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (5 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (2 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) (10 files).
    • exclude files with path like ".*/ThirdParty/.*" (3rd library libraries) (0 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.

main566024 LOC (81%) 998 files
test0 LOC (0%) 0 files
generated93607 LOC (13%) 2109 files
build and deployment112 LOC (<1%) 4 files
other33555 LOC (4%) 221 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
unity
prefab
obj
asset
mat
cginc
shader
anim
mtl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 998 files match defined criteria (566,024 lines of code, 100.0% vs. main code):
    • 49 *.unity files (261,982 lines of code)
    • 94 *.prefab files (80,205 lines of code)
    • 3 *.obj files (73,064 lines of code)
    • 446 *.cs files (64,195 lines of code)
    • 29 *.asset files (35,308 lines of code)
    • 267 *.mat files (26,229 lines of code)
    • 49 *.cginc files (12,942 lines of code)
    • 57 *.shader files (7,204 lines of code)
    • 1 *.anim files (4,720 lines of code)
    • 2 *.java files (172 lines of code)
    • 1 *.mtl files (3 lines of code)
  • " *.unity" is biggest, containing 46.28% of code.
  • " *.mtl" is smallest, containing 0% of code.


*.unity261982 LOC (46%) 49 files
*.prefab80205 LOC (14%) 94 files
*.obj73064 LOC (12%) 3 files
*.cs64195 LOC (11%) 446 files
*.asset35308 LOC (6%) 29 files
*.mat26229 LOC (4%) 267 files
*.cginc12942 LOC (2%) 49 files
*.shader7204 LOC (1%) 57 files
*.anim4720 LOC (<1%) 1 files
*.java172 LOC (<1%) 2 files
*.mtl3 LOC (<1%) 1 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[:] .*".
  • 2109 files match defined criteria (93,607 lines of code, 16.5% vs. main code). All matches are in *.meta files.


*.meta93607 LOC (100%) 2109 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]gradle".
  • 4 files match defined criteria (112 lines of code, 0.0% vs. main code). All matches are in *.gradle files.


*.gradle112 LOC (100%) 4 files
Other Code
unity
prefab
meta
mat
plist
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 221 files match defined criteria (33,555 lines of code, 5.9% vs. main code):
    • 14 *.unity files (21,061 lines of code)
    • 46 *.cs files (6,295 lines of code)
    • 11 *.prefab files (3,189 lines of code)
    • 116 *.meta files (1,229 lines of code)
    • 3 *.json files (616 lines of code)
    • 4 *.mat files (508 lines of code)
    • 6 *.md files (336 lines of code)
    • 16 *.xml files (148 lines of code)
    • 1 *.svg files (98 lines of code)
    • 2 *.plist files (72 lines of code)
    • 2 *.properties files (3 lines of code)
  • " *.unity" is biggest, containing 62.77% of code.
  • " *.properties" is smallest, containing 0.01% of code.


*.unity21061 LOC (62%) 14 files
*.cs6295 LOC (18%) 46 files
*.prefab3189 LOC (9%) 11 files
*.meta1229 LOC (3%) 116 files
*.json616 LOC (1%) 3 files
*.mat508 LOC (1%) 4 files
*.md336 LOC (1%) 6 files
*.xml148 LOC (<1%) 16 files
*.svg98 LOC (<1%) 1 files
*.plist72 LOC (<1%) 2 files
*.properties3 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.obj 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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.anim 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
  • *.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)
  • *.mtl 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 20:21