microsoft / cs_comments_service
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 185 units with 1,740 lines of code in units (30.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (130 lines of code)
    • 4 simple units (168 lines of code)
    • 179 very simple units (1,442 lines of code)
0% | 0% | 7% | 9% | 82%
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
rb0% | 0% | 7% | 8% | 83%
rake0% | 0% | 0% | 26% | 73%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib0% | 0% | 19% | 18% | 62%
presenters0% | 0% | 31% | 17% | 51%
spec0% | 0% | 0% | 9% | 90%
models0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
edx_specs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
handle_threads_query
in lib/helpers.rb
85 14 0
to_hash
in presenters/thread.rb
45 11 4
48 7 3
rake
do_reindex
in lib/tasks/search.rake
30 6 2
merge_response_content
in presenters/thread.rb
26 6 1
check_thread_result
in spec/spec_helper.rb
64 6 4
source
in lib/helpers.rb
12 5 0
self.process_at_notifications
in models/observers/at_user_observer.rb
38 5 1
user
in lib/helpers.rb
4 4 0
vote_for
in lib/helpers.rb
7 4 1
get_sort_criteria
in lib/helpers.rb
18 4 1
get_group_ids_from_params
in lib/helpers.rb
12 4 1
rake
move_alias_to
in lib/tasks/search.rake
19 4 2
self.put_search_index_mapping
in models/content.rb
7 4 1
author_with_anonymity
in models/content.rb
7 4 2
self.generate_activity_and_notifications
in models/observers/post_reply_observer.rb
26 4 1
self.generate_notifications
in models/observers/post_topic_observer.rb
24 4 1
to_hash
in models/user.rb
58 4 1
self.get_read_states
in presenters/thread_utils.rb
23 4 3
8 3 2