Showing 12 of 12 total issues
Function make_windowed_plot
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def make_windowed_plot(self, sequences, jump=1):
"""Generate matrix of scores using window sliding techinque.
Partial scores for particular sequence elements will be calculated
using `get_score` method.
- 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 main_window.py
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QAction
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtWidgets import QWidget
Function make_matplotlib
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def make_matplotlib(self, dot_matrix, subplot, sequences):
"""Generate plot using matplotlib.
Args:
dot_matrix - (list): list of lists representing a dotplot matrix
- 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 main
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def main(argv):
"""Main function running dotplot application.
Args:
argv:
- 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 interpret_arguments
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def interpret_arguments(self, args):
"""Let's try to be more intelligent and guess what the user wants."""
# if we don't have both files given, then:
args.parsed_sequences = self.parse_sequences(args.sequences)
- 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 make_unicode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_unicode(self, dot_matrix):
"""Generate Unicode representation of dotmatrix.
Args:
dot_matrix - (list): list of lists representing a dotplot matrix
- 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_sequence
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_sequence(address, seq_id):
"""
Attempts to download a sequence from given address 3 times,
raises exception if download fails.
- 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 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, default_db='ncbi'):
super().__init__()
self.id_input = QLineEdit(self)
self.id_input.setPlaceholderText('Sequence ID')
Function on_change
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def on_change(self, given_value, caller_name=None):
if caller_name == 'seq_lt':
value = self.seq_len_combo.currentText()
elif caller_name == 'always':
- 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 make_ascii
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_ascii(self, dot_matrix):
"""Generate an ASCII representation of dotmatrix
Args:
dot_matrix - (list): list of lists representing a dotplot matrix
- 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 callback_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def callback_file(self):
file_name, file_type = self.select_sequence_dialog()
if not file_name:
return
- 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 apply_stringency
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def apply_stringency(self, scores):
"""Modify input matrix: place ones if value >= stringenccy, else 0."""
for row in scores:
for i, value in enumerate(row):
row[i] = 1 if value >= self.stringency else 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"