oemof/oemof-solph

View on GitHub

Showing 139 of 424 total issues

File diesel_genset_nonconvex_investment.py has 369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""
General description
-------------------

    File views.py has 368 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    """Modules for providing convenient views for solph results.
    
    See examples for to learn about the possible usage of the provided functions.
    Severity: Minor
    Found in src/oemof/solph/views.py - About 4 hrs to fix

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

          def __init__(
      Severity: Major
      Found in src/oemof/solph/components/experimental/_sink_dsm.py - About 3 hrs to fix

        File dispatch.py has 324 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        """
        General description
        -------------------
        Severity: Minor
        Found in examples/excel_reader/dispatch.py - About 3 hrs to fix

          Function main has 93 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def main():
              ##########################################################################
              # Initialize the energy system and calculate necessary parameters
              ##########################################################################
          
          

            Function offset_converter_example has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def offset_converter_example():
                ##########################################################################
                # Initialize the energy system and calculate necessary parameters
                ##########################################################################
            
            

              Function main has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def main():
                  ###########################################################################
                  # define the cells of the cellular energy system
                  ###########################################################################
                  # define necessary parameters
              Severity: Major
              Found in examples/cellular/cellular.py - About 3 hrs to fix

                Function net_storage_flow has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                def net_storage_flow(results, node_type):
                    """Calculates the net storage flow for storage models that have one
                    input edge and one output edge both with flows within the domain of
                    non-negative reals.
                
                
                Severity: Minor
                Found in src/oemof/solph/views.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 _create has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _create(self, group=None):
                        """Creates the relation for the class:`OffsetConverter`.
                
                        Parameters
                        ----------
                Severity: Minor
                Found in src/oemof/solph/components/_offset_converter.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 __init__ has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    def __init__(
                        self,
                        inputs,
                        outputs,
                        label=None,
                Severity: Minor
                Found in src/oemof/solph/components/_offset_converter.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 _create has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _create(self, group=None):
                        """Creates the linear constraint for the class:`ConverterBlock`
                        block.
                
                        Parameters
                Severity: Minor
                Found in src/oemof/solph/components/_converter.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 _create has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def _create(self, group=None):
                        """
                        Create constraints for GenericCAESBlock.
                
                        Parameters
                Severity: Major
                Found in src/oemof/solph/components/experimental/_generic_caes.py - About 2 hrs to fix

                  Function _shared_constraints_for_non_convex_flows has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _shared_constraints_for_non_convex_flows(self):
                          r"""
                  
                          .. automethod:: _startup_constraint
                          .. automethod:: _max_startup_constraint
                  Severity: Minor
                  Found in src/oemof/solph/flows/_non_convex_flow_block.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 node has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def node(results, node, multiindex=False, keep_none_type=False):
                      """
                      Obtain results for a single node e.g. a Bus or Component.
                  
                      Either a node or its label string can be passed.
                  Severity: Minor
                  Found in src/oemof/solph/views.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 __init__ has 22 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(
                  Severity: Major
                  Found in src/oemof/solph/components/_generic_storage.py - About 2 hrs to fix

                    File cellular.py has 281 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """
                    General description
                    -------------------
                    
                    Cellular energy systems are proposed by the VDE-ETG. They are, as the name
                    Severity: Minor
                    Found in examples/cellular/cellular.py - About 2 hrs to fix

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

                          def __init__(
                      Severity: Major
                      Found in src/oemof/solph/flows/_flow.py - About 2 hrs to fix

                        Function main has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        def main():
                            # Read data file
                            filename = os.path.join(os.getcwd(), "input_data.csv")
                            try:
                                data = pd.read_csv(filename)
                        Severity: Major
                        Found in examples/simple_dispatch/simple_dispatch.py - About 2 hrs to fix

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

                              def _shutdown_costs(self):
                                  r"""
                                  .. math::
                                      \sum_{SHUTDOWNFLOWS} \sum_t Y_{shutdown}(t) \
                                      \cdot c_{shutdown}
                          Severity: Minor
                          Found in src/oemof/solph/flows/_non_convex_flow_block.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 _startup_costs has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def _startup_costs(self):
                                  r"""
                                  .. math::
                                      \sum_{i, o \in STARTUPFLOWS} \sum_t  Y_{startup}(t) \
                                      \cdot c_{startup}
                          Severity: Minor
                          Found in src/oemof/solph/flows/_non_convex_flow_block.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