KarrLab/conv_opt

View on GitHub

Showing 46 of 108 total issues

File core.py has 532 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Module for solving linear and quadratic optimization problems using
multiple open-source and commercials solvers.

:Author: Jonathan Karr <jonrkarr@gmail.com>
:Date: 2017-11-14
Severity: Major
Found in conv_opt/core.py - About 1 day to fix

    Function load has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to SoPlex's data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/soplex.py - About 7 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 load has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to CVXPY's data structure
    
            Args:
                conv_opt_model (:obj:`cvxpy.Problem`): model
    Severity: Minor
    Found in conv_opt/solver/cvxpy.py - About 7 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 load has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to CPLEX's data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/cplex.py - About 6 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 load has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to Gurobi's data structure
    
            Args:
                conv_opt_model (:obj:`gurobipy.Model`): model
    Severity: Minor
    Found in conv_opt/solver/gurobi.py - About 6 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 _load_minimize has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        def _load_minimize(self, conv_opt_model):
            """ Load a model to SciPy's data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/scipy.py - About 6 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 solve has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Open

        def solve(self):
            """ Solve the model
    
            Returns:
                :obj:`Result`: result
    Severity: Minor
    Found in conv_opt/solver/gurobi.py - About 6 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 load has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to CyLP's data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/cylp.py - About 5 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 load has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to MOSEK Optimizer's data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/mosek.py - About 5 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 load has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to XPRESS' data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/xpress.py - About 5 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 load has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to MINOS' data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/minos.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 load has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        def load(self, conv_opt_model):
            """ Load a model to quadprog's data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/quadprog.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 solve has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

        def solve(self):
            """ Solve the model
    
            Returns:
                :obj:`Result`: result
    Severity: Minor
    Found in conv_opt/solver/xpress.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 solve has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

        def solve(self):
            """ Solve the model
    
            Returns:
                :obj:`Result`: result
    Severity: Minor
    Found in conv_opt/solver/scipy.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 _load_linprog has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def _load_linprog(self, conv_opt_model):
            """ Load a model to SciPy's data structure
    
            Args:
                conv_opt_model (:obj:`Model`): model
    Severity: Minor
    Found in conv_opt/solver/scipy.py - About 3 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 solve has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def solve(self):
            """ Solve the model
    
            Returns:
                :obj:`Result`: result
    Severity: Minor
    Found in conv_opt/solver/mosek.py - About 3 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

    File minos.py has 289 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """ MINOS module
    
    References:
    
    * `MINOS <https://web.stanford.edu/group/SOL/minos.htm>`_
    Severity: Minor
    Found in conv_opt/solver/minos.py - About 2 hrs to fix

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

          def load(self, conv_opt_model):
              """ Load a model to GLPK's data structure
      
              Args:
                  conv_opt_model (:obj:`Model`): model
      Severity: Minor
      Found in conv_opt/solver/optlang.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

      File scipy.py has 274 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """ SciPy module
      
      :Author: Jonathan Karr <jonrkarr@gmail.com>
      :Date: 2017-11-22
      :Copyright: 2017, Karr Lab
      Severity: Minor
      Found in conv_opt/solver/scipy.py - About 2 hrs to fix

        Function solve has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
        Open

            def solve(self):
                """ Solve the model
        
                Returns:
                    :obj:`Result`: result
        Severity: Minor
        Found in conv_opt/solver/cplex.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

        Severity
        Category
        Status
        Source
        Language