Showing 26 of 26 total issues
File aligned_textgrid.py
has 451 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Module containing AlignedTextGrid class
"""
from praatio.utilities.constants import Interval
File sequences.py
has 422 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Module includes the `SequenceInterval` base class as well as
`Top` and `Bottom` classes.
"""
Function interleave_class
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def interleave_class(
self,
name:str,
above:SequenceInterval|str = None,
below:SequenceInterval|str = None,
- 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 custom_classes
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def custom_classes(
class_list:list[str] = [],
return_order: list[str] | list[int] | None = None,
points:list[int] = []
) -> list[Type[SequenceInterval]]:
- 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 tiers.py
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Module for TextGrid tier classes that contain `SequenceInterval`s
"""
from praatio.utilities.constants import Interval
Function validate
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def validate(self) -> bool:
"""Validate the subset list
Validation checks to see if
1. The first item in `subset_list` starts at the same time as `self`.
- 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
AlignedTextGrid
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class AlignedTextGrid(WithinMixins):
"""An aligned Textgrid
Args:
textgrid (Textgrid, optional): A `praatio` TextGrid
Function _nestify_tiers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def _nestify_tiers(
self,
textgrid: Textgrid,
entry_classes: list
):
- 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 _relate_tiers
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _relate_tiers(self):
"""_Private method_
creates RelatedTier objects for each set of
nested IntervalTier and entry class
- 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 clone_class
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def clone_class(
entry_class:SequenceInterval|SequencePoint,
recurse = False
) -> SequenceInterval|SequencePoint:
"""Clone an entry class. It will have the same name, but
- 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 _arrange_tiers
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _arrange_tiers(
self,
tiers: list[SequenceTier]
) -> list[SequenceTier]:
"""_Arranges tiers by hierarchy_
- 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 fuse_rightwards
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fuse_rightwards(
self,
label_fun = lambda x, y: " ".join([x, y])
):
"""Fuse the current segment with the following segment
- 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 fuse_leftwards
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fuse_leftwards(
self,
label_fun = lambda x, y: " ".join([x, y])
):
"""Fuse the current segment with the previous segment
- 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 a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
tiers: list[SequenceTier] = [SequenceTier()]
):
super().__init__()
- 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_superset_class
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_superset_class(
cls,
superset_class: type = None
):
"""_Set the superset class_
- 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 __repr__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __repr__(self) -> str:
out_string = f"Class {type(self).__name__}, label: {self.label}"
if self.superset_class:
out_string += f", .superset_class: {self.superset_class.__name__}"
if self.super_instance:
- 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_precedence
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __set_precedence(self):
for idx,seq in enumerate(self.sequence_list):
self.__set_intier(seq)
if idx == 0:
seq.set_initial()
- 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_subset_class
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_subset_class(cls, subset_class = None):
"""summary
Args:
subset_class (Type[SequenceInterval], optional):
- 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 sequence_to_df
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sequence_to_df(
obj: SequenceInterval | SequencePoint,
with_subset: bool = True
) -> pl.DataFrame:
- 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 interleave_class
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def interleave_class(