ramon-oliveira/aorun

View on GitHub

Showing 11 of 15 total issues

Function fit has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    def fit(self, X, y, loss, optimizer='adam', batch_size=32, epochs=10,
            shuffle=True, val_split=0.0, val_data=None, verbose=2):
        """
        verbose: 0, 1 or 2
            - 0 total silence
Severity: Minor
Found in aorun/models.py - About 2 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 fit has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def fit(self, X, y, loss, optimizer='adam', batch_size=32, epochs=10,
Severity: Major
Found in aorun/models.py - About 1 hr to fix

    Function predict has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def predict(self, X, propabilistic=False):
            if not self.ready:
                self._build()
            return_np = False
            if type(X) is np.ndarray:
    Severity: Minor
    Found in aorun/models.py - About 45 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 __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, lr=0.001, beta1=0.9, beta2=0.999, *args, **kwargs):
    Severity: Minor
    Found in aorun/optimizers.py - About 35 mins to fix

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

          def __init__(self, units, length, stateful=False, *args, **kwargs):
      Severity: Minor
      Found in aorun/layers.py - About 35 mins to fix

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

            def __init__(self, filters, kernel_size, stride=1, *args, **kwargs):
        Severity: Minor
        Found in aorun/layers.py - About 35 mins to fix

          Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get(obj):
              if hasattr(obj, 'step'):
                  return obj
              elif type(obj) is str:
                  if obj in globals():
          Severity: Minor
          Found in aorun/optimizers.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

          Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get(obj):
              if callable(obj):
                  return obj
              elif type(obj) is str:
                  if obj in globals():
          Severity: Minor
          Found in aorun/initializers.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

          Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get(obj):
              if callable(obj):
                  return obj
              elif type(obj) is str:
                  if obj in globals():
          Severity: Minor
          Found in aorun/losses.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

          Function get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get(obj):
              if callable(obj):
                  return obj
              elif type(obj) is str:
                  if obj in globals():
          Severity: Minor
          Found in aorun/activations.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

          Function get_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          def get_file(url, cache_subdir):
              path = os.path.expanduser(os.path.join('~/.aorun', cache_subdir))
              os.makedirs(path, exist_ok=True)
              filepath = os.path.join(path, url.split('/')[-1])
              if not os.path.exists(filepath):
          Severity: Minor
          Found in aorun/utils.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