Showing 26 of 32 total issues
Chebfun
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class Chebfun:
def __init__(self, funs):
self.funs = check_funs(funs)
self.breakdata = compute_breakdata(self.funs)
self.transposed = False
Chebtech
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class Chebtech(Smoothfun, ABC):
"""Abstract base class serving as the template for Chebtech1 and
Chebtech2 subclasses.
Chebtech objects always work with first-kind coefficients, so much
File chebtech.py
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
from abc import ABC, abstractmethod
import numpy as np
from .smoothfun import Smoothfun
Onefun
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Onefun(ABC):
# --------------------------
# alternative constructors
# --------------------------
@abstractclassmethod
Fun
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Fun(ABC):
# --------------------------
# alternative constructors
# --------------------------
@abstractclassmethod
File chebfun.py
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
import operator
import numpy as np
from .bndfun import Bndfun
Classicfun
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Classicfun(Fun, ABC):
# --------------------------
# alternative constructors
# --------------------------
@classmethod
File algorithms.py
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
import warnings
import numpy as np
from .ffts import fft, ifft
Function preandpostprocess
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def preandpostprocess(f):
"""Pre- and post-processing tasks common to bary and clenshaw"""
@wraps(f)
def thewrapper(*args, **kwargs):
- 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 standard_chop
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def standard_chop(coeffs, tol=None):
"""Chop a Chebyshev series to a given tolerance. This is a Python
transcription of the algorithm described in:
J. Aurentz and L.N. Trefethen, Chopping a Chebyshev series (2015)
- 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__
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def __add__(self, f):
cls = self.__class__
if np.isscalar(f):
if np.iscomplexobj(f):
dtype = complex
- 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 float_argument
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def float_argument(f):
"""Chebfun classmethod wrapper for __call__: ensure that we provide
float output for float input and array output otherwise"""
@wraps(f)
- 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 addBinaryOp
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def addBinaryOp(methodname):
@self_empty()
def method(self, f, *args, **kwds):
cls = self.__class__
if isinstance(f, cls):
- 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 chebfun
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def chebfun(f=None, domain=None, n=None):
"""Chebfun constructor"""
# chebfun()
if f is None:
return Chebfun.initempty()
- 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 bary
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def bary(xx, fk, xk, vk):
"""Barycentric interpolation formula. See:
J.P. Berrut, L.N. Trefethen, Barycentric Lagrange Interpolation, SIAM
Review (2004)
- 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 initfun_fixedlen
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initfun_fixedlen(cls, f, n, domain=None):
nn = np.array(n)
if nn.size < 2:
funs = generate_funs(domain, Bndfun.initfun_fixedlen, {"f": f, "n": n})
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 self_empty
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self_empty(resultif=None):
"""Factory method to produce a decorator that checks whether the object
whose classmethod is being wrapped is empty, returning the object if
so, but returning the supplied resultif if not. (Used in chebtech.py)"""
- 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 rootsunit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def rootsunit(ak, htol=None):
"""Compute the roots of a funciton on [-1,1] using the coefficeints
in the associated Chebyshev series representation.
References
- 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 plotfun
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def plotfun(fun, support, ax=None, N=None, **kwds):
Function roots
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def roots(self, merge=None):
"""Compute the roots of a Chebfun, i.e., the set of values x for which
f(x) = 0.
"""
merge = merge if merge is not None else prefs.mergeroots
- 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"