tensorflow / text
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 569 units with 8,951 lines of code in units (65.4% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (213 lines of code)
    • 18 medium complex units (1,043 lines of code)
    • 87 simple units (3,024 lines of code)
    • 463 very simple units (4,671 lines of code)
0% | 2% | 11% | 33% | 52%
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
cc0% | 4% | 16% | 34% | 45%
py0% | 0% | 7% | 33% | 59%
h0% | 0% | 1% | 30% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_text/core/kernels0% | 3% | 14% | 34% | 46%
tensorflow_text/python/ops0% | 0% | 9% | 36% | 53%
tensorflow_text/tools/wordpiece_vocab0% | 0% | 7% | 21% | 70%
tensorflow_text/python/benchmarks0% | 0% | 0% | 27% | 72%
tensorflow_text/python/numpy0% | 0% | 0% | 100% | 0%
tensorflow_text/python/keras0% | 0% | 0% | 22% | 77%
tensorflow_text/python/metrics0% | 0% | 0% | 100% | 0%
oss_scripts0% | 0% | 0% | 50% | 50%
tensorflow_text/core/ops0% | 0% | 0% | 0% | 100%
oss_scripts/pip_package0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void ViterbiAnalysis()
in tensorflow_text/core/kernels/constrained_sequence.cc
213 47 7
absl::Status FastWordpieceBuilder::BuildFailureStructure()
in tensorflow_text/core/kernels/fast_wordpiece_tokenizer_model_builder.cc
113 21 1
bool FragmentBoundaryMatch::Advance()
in tensorflow_text/core/kernels/sentence_fragmenter_v2.cc
59 20 2
inline bool IsPunctuationOrChineseChar()
in tensorflow_text/core/kernels/fast_wordpiece_tokenizer_utils.h
14 19 1
def learn_with_thresh()
in tensorflow_text/tools/wordpiece_vocab/wordpiece_tokenizer_learner_lib.py
50 19 3
void GreedyAnalysis()
in tensorflow_text/core/kernels/constrained_sequence.cc
58 17 7
Status Advance()
in tensorflow_text/core/kernels/sentence_fragmenter.cc
50 17 4
void Compute()
in tensorflow_text/core/kernels/sentencepiece_kernels.cc
97 16 1
void Compute()
in tensorflow_text/core/kernels/sentencepiece_kernels.cc
105 16 1
def pad_along_dimension()
in tensorflow_text/python/ops/pad_along_dimension_op.py
27 15 5
void FastWordpieceTokenizer::TokenizeTextImpl()
in tensorflow_text/core/kernels/fast_wordpiece_tokenizer.cc
74 14 5
void Compute()
in tensorflow_text/core/kernels/unicode_script_tokenize_kernel.cc
84 14 1
def span_overlaps()
in tensorflow_text/python/ops/pointer_ops.py
63 13 8
void Compute()
in tensorflow_text/core/kernels/constrained_sequence_kernel.cc
88 12 1
Status UnicodeUtil::IsClosePunc()
in tensorflow_text/core/kernels/sentence_breaking_utils.cc
32 12 2
Status UnicodeUtil::IsTerminalPunc()
in tensorflow_text/core/kernels/sentence_breaking_utils.cc
28 11 2
def sliding_window()
in tensorflow_text/python/ops/sliding_window_op.py
24 11 4
def create_feature_bitmask()
in tensorflow_text/python/ops/create_feature_bitmask_op.py
41 11 3
def ngrams()
in tensorflow_text/python/ops/ngrams_op.py
36 11 6
Status UnicodeUtil::IsPunctuationWord()
in tensorflow_text/core/kernels/sentence_breaking_utils.cc
25 10 2