Showing 7 of 7 total issues
File proxy.py
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Mark Lee
#
# This program is free software: you can redistribute it and/or modify
Function list_devices
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def list_devices(show_desktop, show_mobile):
"""
List device IDs registered with Google Music.
Defaults to showing both desktop and mobile IDs.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function gmusic_playlist_to_xspf
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def gmusic_playlist_to_xspf(playlist_id, playlist):
"""
Convert a playlist from gmusicapi into an XSPF playlist.
:type playlist: dict
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function requires_from_req_txt
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def requires_from_req_txt(filename):
requires = []
with open(filename) as f:
for line in f:
req = RE_REQ_COMMENT.sub('', line).strip()
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function convert_google_field_to_mp3
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def convert_google_field_to_mp3(google_value):
"""
Convert a Google metadata field value to the equivalent ID3 tag value.
:rtype: str
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_song_mp3
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_song_mp3(song_id):
"""Retrieve the MP3 for a given ID."""
song_url = music.get_stream_url(song_id, app.config['GACCOUNT_DEVICE_ID'])
if app.config['GMP_SONG_FILTERS']:
response = requests.get(song_url)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Open
return str(google_value)