microsoft / python-sample-tweeterapp
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 21 units with 207 lines of code in units (23.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (84 lines of code)
    • 2 small units (28 lines of code)
    • 17 very small units (95 lines of code)
0% | 0% | 40% | 13% | 45%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 55% | 11% | 33%
py0% | 0% | 0% | 19% | 80%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tweeter/src/components0% | 0% | 55% | 11% | 33%
tweeter0% | 0% | 0% | 19% | 80%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in tweeter/src/components/Tweets.js
43 3 0
render()
in tweeter/src/components/App.js
41 2 0
async addTweet()
in tweeter/src/components/Tweets.js
17 1 0
def test_tweet_creation()
in tweeter/tests.py
11 1 1
def validate_text()
in tweeter/serializers.py
10 3 2
componentDidMount()
in tweeter/src/components/DataProvider.js
10 2 0
constructor()
in tweeter/src/components/App.js
7 1 1
constructor()
in tweeter/src/components/Tweets.js
7 1 1
componentWillReceiveProps()
in tweeter/src/components/DataProvider.js
6 2 1
constructor()
in tweeter/src/components/Tweets.js
6 1 1
render()
in tweeter/src/components/Tweets.js
6 2 0
6 1 1
6 1 1
def has_object_permission()
in tweeter/permissions.py
5 2 4
async getSentiment()
in tweeter/src/components/Tweets.js
5 1 0
def perform_create()
in tweeter/views.py
5 2 2
def has_object_permission()
in tweeter/permissions.py
4 3 4
def create_user()
in tweeter/views.py
4 1 1
componentDidMount()
in tweeter/src/components/Tweets.js
3 1 0
def current_user()
in tweeter/views.py
3 1 1