paradoxysm/nnrf

View on GitHub

Showing 10 of 19 total issues

Function fit has a Cognitive Complexity of 35 (exceeds 10 allowed). Consider refactoring.
Open

    def fit(self, X, Y, *args, weights=None, **kwargs):
        """
        Train the model on the given data and labels.

        Parameters
Severity: Minor
Found in nnrf/utils/_estimator.py - About 4 hrs to fix

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 16 arguments (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, n=50, d=5, r='sqrt', optimizer='adam', loss='cross-entropy',
Severity: Major
Found in nnrf/_nnrf.py - About 1 hr to fix

    Function __init__ has 14 arguments (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, d=5, r='sqrt', loss='cross-entropy',
    Severity: Major
    Found in nnrf/_nndt.py - About 1 hr to fix

      Function __init__ has 13 arguments (exceeds 5 allowed). Consider refactoring.
      Open

          def __init__(self, layers=(100,), activation='relu', loss='cross-entropy',
      Severity: Major
      Found in nnrf/_nn.py - About 1 hr to fix

        Function fit has a Cognitive Complexity of 16 (exceeds 10 allowed). Consider refactoring.
        Open

            def fit(self, X, Y, weights=None):
                """
                Train the model on the given data and labels.
        
                Parameters
        Severity: Minor
        Found in nnrf/_nnrf.py - About 1 hr to fix

        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_params has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.
        Open

            def set_params(self, params):
                """
                Set the attributes of the object with the given
                parameters.
        
        
        Severity: Minor
        Found in nnrf/utils/_base.py - About 1 hr to fix

        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 9 arguments (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, loss='cross-entropy', max_iter=100, tol=1e-4,
        Severity: Major
        Found in nnrf/utils/_estimator.py - About 1 hr to fix

          Function __init__ has 8 arguments (exceeds 5 allowed). Consider refactoring.
          Open

              def __init__(self, ensemble, k=100, leaf_size=40,
          Severity: Major
          Found in nnrf/_des_knn.py - About 50 mins to fix

            Function get_activation has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
            Open

            def get_activation(name):
                """
                Lookup table of default activation functions.
            
                Parameters
            Severity: Minor
            Found in nnrf/ml/activation.py - About 35 mins to fix

            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 organize has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
            Open

                def organize(self, prepend=[], append=[]):
                    """
                    Organize the BatchDataset according to `order`.
                    In this manner, the order of shuffle, repeat, and
                    batch affect how the data is drawn.
            Severity: Minor
            Found in nnrf/utils/_batch_dataset.py - About 25 mins to fix

            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

            Severity
            Category
            Status
            Source
            Language