dart-lang / ffigen
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 603 units with 6,150 lines of code in units (41.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (105 lines of code)
    • 10 medium complex units (472 lines of code)
    • 25 simple units (861 lines of code)
    • 567 very simple units (4,712 lines of code)
0% | 1% | 7% | 14% | 76%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
dart0% | 1% | 7% | 14% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/src/header_parser0% | 6% | 9% | 19% | 64%
lib/src/code_generator0% | 0% | 32% | 11% | 55%
lib/src/config_provider0% | 0% | 14% | 45% | 40%
lib/src/executables0% | 0% | 0% | 23% | 76%
example/c_json0% | 0% | 0% | 8% | 91%
example/libclang-example0% | 0% | 0% | 0% | 100%
example/simple0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Type getCodeGenType()
in lib/src/header_parser/type_extractor/extractor.dart
105 26 3
bool declarationConfigValidator()
in lib/src/config_provider/spec_utils.dart
66 22 2
Compound? parseCompoundDeclaration()
in lib/src/header_parser/sub_parsers/compounddecl_parser.dart
84 19 5
BindingString toBindingString()
in lib/src/code_generator/func.dart
66 17 1
String getDartType()
in lib/src/code_generator/type.dart
41 16 1
String getCType()
in lib/src/code_generator/type.dart
32 14 1
String _getWritableChar()
in lib/src/header_parser/sub_parsers/macro_parser.dart
34 14 2
bool commentValidator()
in lib/src/config_provider/spec_utils.dart
31 12 2
Typealias? parseTypedefDeclaration()
in lib/src/header_parser/sub_parsers/typedefdecl_parser.dart
49 12 3
CommentType commentExtractor()
in lib/src/config_provider/spec_utils.dart
28 11 1
BindingString toBindingString()
in lib/src/code_generator/compound.dart
41 11 1
String findDylibAtDefaultLocations()
in lib/src/config_provider/spec_utils.dart
25 10 0
Declaration declarationConfigExtractor()
in lib/src/config_provider/spec_utils.dart
67 10 1
int _compoundMembersVisitor()
in lib/src/header_parser/sub_parsers/compounddecl_parser.dart
49 10 3
bool shouldInclude()
in lib/src/config_provider/config_types.dart
23 9 1
SupportedNativeType nativeSupportedType()
in lib/src/config_provider/spec_utils.dart
15 9 2
String generate()
in lib/src/code_generator/writer.dart
44 9 0
int _rootCursorVisitor()
in lib/src/header_parser/translation_unit_parser.dart
38 9 3
void _setMembers()
in lib/src/header_parser/sub_parsers/compounddecl_parser.dart
44 9 2
int _macroVariablevisitor()
in lib/src/header_parser/sub_parsers/macro_parser.dart
57 9 3