ulikoehler/UliEngineering

View on GitHub

Showing 64 of 64 total issues

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

def differential_microstrip_impedance(w, d, h=DielectricHeight.L4_1p6mm, t="35 μm", e_r=RelativePermittivity.FR4) -> Unit("Ω"):
Severity: Minor
Found in UliEngineering/Electronics/Microstrip.py - About 35 mins to fix

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

    def ntc_resistances(r25, b25, t0=-40, t1=85, resolution=0.1):
    Severity: Minor
    Found in UliEngineering/Physics/NTC.py - About 35 mins to fix

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

      def extract_column(flo, isline=__standard_isline, preproc=_strip_newline,
      Severity: Minor
      Found in UliEngineering/Utils/Files.py - About 35 mins to fix

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

            def __init__(self, data, index_generator, num_chunks, func=None, copy=False):
        Severity: Minor
        Found in UliEngineering/SignalProcessing/Chunks.py - About 35 mins to fix

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

              def __init__(self, units=_default_units(),
          Severity: Minor
          Found in UliEngineering/EngineerIO.py - About 35 mins to fix

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

            def optimum_polyfit(x, y, score=functoolz.compose(np.max, np.abs), max_degree=50, stop_at=1e-10):
            Severity: Minor
            Found in UliEngineering/SignalProcessing/Utils.py - About 35 mins to fix

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

              def sliding_window(data, window_size, shift_size=1, window_func=None, copy=False):
              Severity: Minor
              Found in UliEngineering/SignalProcessing/Chunks.py - About 35 mins to fix

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

                def generate_datetime_filename(label="data", extension="csv", postfix=None, fractional=True, dt=None):
                Severity: Minor
                Found in UliEngineering/Utils/Date.py - About 35 mins to fix

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

                  def extract_column(flo, isline=__standard_isline, preproc=_strip_newline,
                                     postproc=functoolz.identity, extractcol=_csv_firstcol):
                      """
                      Lazily extract a column from a file, for example extract a column from a CSV file.
                      The values are run through a postprocessing function and placed in a list which is returned.
                  Severity: Minor
                  Found in UliEngineering/Utils/Files.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 normalize_numeric_verify_unit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def normalize_numeric_verify_unit(self, arg, reference: Unit):
                          """
                          Normalize a value. If it is a string
                          verify if its unit matches the reference unit.
                          """
                  Severity: Minor
                  Found in UliEngineering/EngineerIO.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

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  def hash_file_md5(file_path, binary=False, buffer_size=65536):
                      """
                      Compute the MD5 hash of a file.
                  
                      :param file_path: The path to the file to hash
                  Severity: Minor
                  Found in UliEngineering/Filesystem/Hash.py and 2 other locations - About 35 mins to fix
                  UliEngineering/Filesystem/Hash.py on lines 48..57
                  UliEngineering/Filesystem/Hash.py on lines 70..79

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      def normalize(self, s, encoding="utf8"):
                          """
                          Converts an engineer's input of a wide variety of formats to a numeric
                          value.
                  
                  
                  Severity: Minor
                  Found in UliEngineering/EngineerIO.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

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  def hash_file_sha1(file_path, binary=False, buffer_size=65536):
                      """
                      Compute the SHA1 hash of a file.
                  
                      :param file_path: The path to the file to hash
                  Severity: Minor
                  Found in UliEngineering/Filesystem/Hash.py and 2 other locations - About 35 mins to fix
                  UliEngineering/Filesystem/Hash.py on lines 48..57
                  UliEngineering/Filesystem/Hash.py on lines 59..68

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  def _normalize_frequencies(freqs):
                      # Normalize freqs: Allow [1.0] instead of 1.0
                      if freqs is None:
                          raise ValueError("Critical frequencies may not be None")
                      # Allow multiple frequencies, but only 1 or 2
                  Severity: Minor
                  Found in UliEngineering/SignalProcessing/Filter.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

                  Similar blocks of code found in 3 locations. Consider refactoring.
                  Open

                  def hash_file_sha256(file_path, binary=False, buffer_size=65536):
                      """
                      Compute the SHA256 hash of a file.
                  
                      :param file_path: The path to the file to hash
                  Severity: Minor
                  Found in UliEngineering/Filesystem/Hash.py and 2 other locations - About 35 mins to fix
                  UliEngineering/Filesystem/Hash.py on lines 59..68
                  UliEngineering/Filesystem/Hash.py on lines 70..79

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 33.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                      def delete_all(self):
                          """
                          Force-delete all files and directories created by this instance.
                          The class instance may be used without restriction after this call
                          """
                  Severity: Minor
                  Found in UliEngineering/Utils/Temporary.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

                  Avoid too many return statements within this function.
                  Open

                          return window_id(size, param)
                  Severity: Major
                  Found in UliEngineering/SignalProcessing/Window.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return np.ones(size)
                    Severity: Major
                    Found in UliEngineering/SignalProcessing/Window.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return np.kaiser(size, 2.0 if param is None else param)
                      Severity: Major
                      Found in UliEngineering/SignalProcessing/Window.py - About 30 mins to fix

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

                        def _format_with_suffix(v, suffix="", significant_digits=3):
                            """
                            Format a given value with a given suffix.
                            This helper function formats the value to 3 visible digits.
                            v must be pre-multiplied by the factor implied by the suffix.
                        Severity: Minor
                        Found in UliEngineering/EngineerIO.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