File seqrecord.py
has 562 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2013-2023 by Björn Johansson. All rights reserved.
# This code is part of the Python-dna distribution and governed by its
SeqRecord
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class SeqRecord(_SeqRecord):
"""
A subclass of the Biopython SeqRecord class.
Has a number of extra methods and uses
Function add_feature
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_feature(self, x=None, y=None, seq=None, type_="misc", strand=1, *args, **kwargs):
"""Add a feature of type misc to the feature list of the sequence.
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 lcs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def lcs(self, other, *args, limit=25, **kwargs):
"""Return the longest common substring between the sequence.
and another sequence (other). The other sequence can be a string,
Seq, SeqRecord, Dseq or DseqRecord.
- 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 add_feature
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_feature(self, x=None, y=None, seq=None, type_="misc", strand=1, *args, **kwargs):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, seq, *args, id="id", name="name", description="description", **kwargs):
Function list_features
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def list_features(self):
"""Print ASCII table with all features.
Examples
--------
- 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"