Showing 42 of 219 total issues
File table.py
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import platform
import json
import sys
import shutil
Function download
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def download(self, docid):
if docid:
doc_folder = os.path.join(self.FOLDER, docid)
if not os.path.exists(doc_folder):
os.makedirs(doc_folder)
- 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 evaluate_checked_signal
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def evaluate_checked_signal(self, type, item, is_checked):
if item == 'pitch' or item == 'pitch_filtered':
if is_checked:
self.player_frame.plot_1d_data(type, item)
else:
- 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_filenames_in_dir
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def get_filenames_in_dir(dir_name, keyword='*.mp3', skip_foldername='',
match_case=True, verbose=None):
names = []
folders = []
fullnames = []
- 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
File playerframe.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os
import json
import numpy as np
import pyqtgraph.dockarea as pgdock
Function run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def run(self):
self.recordings = []
self.works = []
check_list = [self.mid, self.fid, self.uid, self.cmbid, self.ambid]
self.combobox_status = [0, 0, 0, 0, 0, 0]
- 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_design
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _set_design(self, docid):
self.resize(710, 550)
self.central_widget = QWidget()
layout = QVBoxLayout(self.central_widget)
Function player_pos_changed
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def player_pos_changed(self, playback_pos):
"""
Updates the positions of cursors when playback position is changed.
Changes the waveform region item according to the position of playback.
- 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 _parse_dict
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _parse_dict(self):
"""
Parses the given metadata dictionary.
"""
self.root_title = QTreeWidgetItem(self, ['Title'])
- 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 check_doc
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def check_doc(docid):
"""Checks if all the features are downloaded correctly or not"""
docid = str(docid)
if os.path.exists(os.path.join(FOLDER, docid)):
docid = str(docid)
- 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 __init__
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent=None):
QWidget.__init__(self, parent)
# self._set_widget()
layout = QVBoxLayout(self)
Function _set_layout
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _set_layout(self, layout):
"""Sets the size policies of layout and initializes the comoboxes and
query button."""
layout.setSizeConstraint(QLayout.SetNoConstraint)
layout.setMargin(MARGIN)
Function _dunya_query_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _dunya_query_file(path, **kwargs):
"""Make a query to dunya and return the raw result"""
g = _dunya_url_query(_make_url(path, **kwargs))
if g:
cl = g.headers.get('content-length')
- 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 __init__
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent=None):
QFrame.__init__(self, parent)
# grid layout for main window
layout_main = QGridLayout(self)
Function __init__
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent=None):
QFrame.__init__(self, parent=parent)
self._set_size_policy()
self._set_visualization()
Function wf_region_changed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def wf_region_changed(self):
"""
Updates the plots according to the change in waveform region item.
"""
pos = self.playback.position() / 1000. # playback pos in seconds
- 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 __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, QWidgetParent=None):
QMainWindow.__init__(self, QWidgetParent)
self._set_main_window()
self.centralwidget = QWidget(self)
Function __init__
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, parent=None):
QDialog.__init__(self, parent)
self.attribute = None
self.setFixedSize(200, 300)
Function _parse_dict
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _parse_dict(self):
"""
Parses the given metadata dictionary.
"""
self.root_title = QTreeWidgetItem(self, ['Title'])
Function dropEvent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def dropEvent(self, event):
# The QTableWidget from which selected rows will be moved
sender = event.source()
# Default dropEvent method fires dropMimeData with appropriate
- 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"