microsoft / cs_comments_service
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 185 units with 1,740 lines of code in units (30.0% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (277 lines of code)
    • 14 medium size units (426 lines of code)
    • 24 small units (346 lines of code)
    • 143 very small units (691 lines of code)
0% | 15% | 24% | 19% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
rb0% | 17% | 21% | 19% | 41%
rake0% | 0% | 60% | 32% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
spec0% | 20% | 11% | 23% | 44%
lib0% | 19% | 27% | 29% | 23%
models0% | 12% | 29% | 7% | 50%
presenters0% | 0% | 64% | 16% | 18%
ROOT0% | 0% | 0% | 0% | 100%
edx_specs0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
handle_threads_query
in lib/helpers.rb
85 14 0
init_without_subscriptions
in spec/spec_helper.rb
70 3 0
check_thread_result
in spec/spec_helper.rb
64 6 4
to_hash
in models/user.rb
58 4 1
48 7 3
to_hash
in presenters/thread.rb
45 11 4
rake
generate_comments_for
in lib/tasks/db.rake
38 2 4
self.process_at_notifications
in models/observers/at_user_observer.rb
38 5 1
rake
do_reindex
in lib/tasks/search.rake
30 6 2
to_hash
in models/comment.rb
29 3 1
self.generate_activity_and_notifications
in models/observers/post_reply_observer.rb
26 4 1
merge_response_content
in presenters/thread.rb
26 6 1
self.summary what
in models/content.rb
25 3 0
test_paged_order
in spec/api/comment_thread_spec.rb
25 2 4
get_thread_notification
in spec/api/notifications_spec.rb
25 1 2
self.generate_notifications
in models/observers/post_topic_observer.rb
24 4 1
check_question_response_paging
in spec/spec_helper.rb
24 2 6
self.get_read_states
in presenters/thread_utils.rb
23 4 3
rake
move_alias_to
in lib/tasks/search.rake
19 4 2
get_sort_criteria
in lib/helpers.rb
18 4 1