sami2py/sami2py

View on GitHub

Showing 12 of 20 total issues

Function run_model has 47 arguments (exceeds 4 allowed). Consider refactoring.
Open

def run_model(tag='model_run', lat=0.0, lon=0.0, alt=300.0, year=2018, day=1,
Severity: Major
Found in sami2py/_core.py - About 5 hrs to fix

    File _core.py has 390 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    # Copyright (C) 2017, JK & JH
    # Full license can be found in License.md
    # -----------------------------------------------------------------------------
    Severity: Minor
    Found in sami2py/_core.py - About 5 hrs to fix

      File _core_class.py has 342 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      # -*- coding: utf-8 -*-
      # Copyright (C) 2017, JK & JH
      # Full license can be found in License.md
      # -----------------------------------------------------------------------------
      Severity: Minor
      Found in sami2py/_core_class.py - About 4 hrs to fix

        Function _generate_metadata has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def _generate_metadata(self, namelist, model_path):
                """Read the namelist and generates MetaData based on Parameters.
        
                Parameters
                -----------
        Severity: Minor
        Found in sami2py/_core_class.py - About 1 hr to fix

          Function _generate_namelist has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def _generate_namelist(info):
              """Generate namelist file for sami2.
          
              Parameters
              ----------
          Severity: Minor
          Found in sami2py/_core.py - About 1 hr to fix

            Function _generate_drift_info has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
            Open

            def _generate_drift_info(fejer, exb_drifts=None):
                """Generate the information regarding the ExB drifts used by the model.
            
                This information is later stored in the namelist file for SAMI2
            
            
            Severity: Minor
            Found in sami2py/_core.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 _archive_model has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            def _archive_model(path, clean, fejer, fmtout, outn):
                """Move the model output files to a common archive.
            
                Parameters
                ----------
            Severity: Minor
            Found in sami2py/_core.py - About 55 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 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, tag, lon, year, day, outn=False, test=False):
            Severity: Minor
            Found in sami2py/_core_class.py - About 45 mins to fix

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

                  def _load_model(self):
                      """Load model results."""
              
                      nf = 98
                      nz = 101
              Severity: Minor
              Found in sami2py/_core_class.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 generate_path has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def generate_path(tag, lon, year, day, test=False):
              Severity: Minor
              Found in sami2py/utils.py - About 35 mins to fix

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

                def _archive_model(path, clean, fejer, fmtout, outn):
                Severity: Minor
                Found in sami2py/_core.py - About 35 mins to fix

                  Function run_model has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def run_model(tag='model_run', lat=0.0, lon=0.0, alt=300.0, year=2018, day=1,
                                f107=120.0, f107a=120.0, ap=0,
                                rmin=100.0, rmax=2000.0, gams=3, gamp=3, altmin=85.0,
                                dthr=0.25, hrinit=0.0, hrpr=24.0, hrmax=48.0,
                                dt0=30., maxstep=100000000, denmin=1.e-6,
                  Severity: Minor
                  Found in sami2py/_core.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

                  Severity
                  Category
                  Status
                  Source
                  Language