dart-lang / ffigen
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 603 units with 6,150 lines of code in units (41.4% of code).
    • 1 very long units (105 lines of code)
    • 7 long units (454 lines of code)
    • 41 medium size units (1,284 lines of code)
    • 86 small units (1,171 lines of code)
    • 468 very small units (3,136 lines of code)
1% | 7% | 20% | 19% | 50%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart1% | 7% | 20% | 19% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src/header_parser6% | 14% | 31% | 9% | 38%
lib/src/config_provider0% | 15% | 36% | 33% | 15%
lib/src/code_generator0% | 12% | 38% | 9% | 39%
example/libclang-example0% | 0% | 4% | 18% | 76%
lib/src/executables0% | 0% | 53% | 31% | 15%
example/c_json0% | 0% | 8% | 41% | 50%
example/simple0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Type getCodeGenType()
in lib/src/header_parser/type_extractor/extractor.dart
105 26 3
Compound? parseCompoundDeclaration()
in lib/src/header_parser/sub_parsers/compounddecl_parser.dart
84 19 5
Declaration declarationConfigExtractor()
in lib/src/config_provider/spec_utils.dart
67 10 1
bool declarationConfigValidator()
in lib/src/config_provider/spec_utils.dart
66 22 2
BindingString toBindingString()
in lib/src/code_generator/func.dart
66 17 1
Func? parseFunctionDeclaration()
in lib/src/header_parser/sub_parsers/functiondecl_parser.dart
58 8 1
int _macroVariablevisitor()
in lib/src/header_parser/sub_parsers/macro_parser.dart
57 9 3
Type _extractfromRecord()
in lib/src/header_parser/type_extractor/extractor.dart
56 7 2
Typealias? parseTypedefDeclaration()
in lib/src/header_parser/sub_parsers/typedefdecl_parser.dart
49 12 3
int _compoundMembersVisitor()
in lib/src/header_parser/sub_parsers/compounddecl_parser.dart
49 10 3
ArgResults getArgResults()
in lib/src/executables/ffigen.dart
44 3 1
String generate()
in lib/src/code_generator/writer.dart
44 9 0
void _setMembers()
in lib/src/header_parser/sub_parsers/compounddecl_parser.dart
44 9 2
List parseToBindings()
in lib/src/header_parser/parser.dart
42 5 0
String getDartType()
in lib/src/code_generator/type.dart
41 16 1
BindingString toBindingString()
in lib/src/code_generator/compound.dart
41 11 1
List getCStandardLibraryHeadersForMac()
in lib/src/config_provider/path_finder.dart
39 8 0
int _rootCursorVisitor()
in lib/src/header_parser/translation_unit_parser.dart
38 9 3
Headers headersExtractor()
in lib/src/config_provider/spec_utils.dart
36 8 1
List? parseSavedMacros()
in lib/src/header_parser/sub_parsers/macro_parser.dart
36 3 0