File api.py
has 963 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Low level api to communicate with samsung multiroom speaker."""
import inspect
import logging
import urllib.parse
SamsungMultiroomApi
has 68 functions (exceeds 20 allowed). Consider refactoring. Open
class SamsungMultiroomApi:
"""
Samsung Multiroom Api implementation.
Contains non-inclusive list of API calls you can make to control the speaker.
Function format_param
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def format_param(param):
"""
Format request parameter.
:param param: Tuple e.g. ('list_count', 30, 'dec')
- 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 set_alarm_info
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_alarm_info(self, index, hour, minute, week, duration, volume, station_data):
Function paginator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def paginator(*args):
"""
Generator to paginate over api call.
Api method must accept start_index and list_count parameters.
- 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 set_playlist_playback_control
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_playlist_playback_control(self, items):
"""
Create a playlist and playback.
Use pc_get_music_list_by_id() to fetch item information required for playlist item.
- 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"