petspats/pyha

View on GitHub

Showing 164 of 164 total issues

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

        out0[2], out0[3] = butterfly(inp[2], inp[3], W(2, 8))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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 _pyha_floats_to_fixed has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def _pyha_floats_to_fixed(self, silence=False):
        """ Go over the datamodel and convert floats to sfix, this is done before RTL/GATE simulation """
        from pyha.common.complex import default_complex
        if hasattr(self.data[0], '_pyha_update_registers'):  # is submodule
            for x in self.data:
Severity: Minor
Found in pyha/common/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 __log_none_bounds has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def __log_none_bounds(self):

        def get_full_var_name():
            ret = []
            node = self
Severity: Minor
Found in pyha/conversion/type_transforms.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

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

        out1[5], out1[7] = butterfly(out0[5], out0[7], W(1, 4))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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

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

        out2[3], out2[7] = butterfly(out1[3], out1[7], W(0, 2))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69

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 43.

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

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

        out0[0], out0[1] = butterfly(inp[0], inp[1], W(0, 8))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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 __log_none_bounds has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def __log_none_bounds(self):

        def get_full_var_name():
            ret = []
            node = self
Severity: Minor
Found in pyha/conversion/type_transforms.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

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

        out0[2], out0[3] = butterfly(inp[2], inp[3], W(1, 4))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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

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

        out1[0], out1[2] = butterfly(out0[0], out0[2], W(0, 2))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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

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

        out0[6], out0[7] = butterfly(inp[6], inp[7], W(3, 8))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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

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

    if fft_size == 2:
        out[0], out[1] = butterfly(inp[0], inp[1], W(0, 2))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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 get_objects_rednode has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

def get_objects_rednode(obj):
    """
    Returns the RedBaron node for the class instance.
    This mocks the inspect module to improve the code search resolution (in general inspect finds all the classes from file that match the name and just returns the first)

Severity: Minor
Found in pyha/conversion/conversion.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

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

        out1[1], out1[3] = butterfly(out0[1], out0[3], W(0, 2))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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

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

        out2[2], out2[6] = butterfly(out1[2], out1[6], W(0, 2))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 57..57
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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

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

        out0[4], out0[5] = butterfly(inp[4], inp[5], W(1, 8))
Severity: Major
Found in pyha/cores/fft/fft_core/dev/reference.py and 16 other locations - About 1 hr to fix
pyha/cores/fft/fft_core/dev/reference.py on lines 41..42
pyha/cores/fft/fft_core/dev/reference.py on lines 45..45
pyha/cores/fft/fft_core/dev/reference.py on lines 46..46
pyha/cores/fft/fft_core/dev/reference.py on lines 49..49
pyha/cores/fft/fft_core/dev/reference.py on lines 50..50
pyha/cores/fft/fft_core/dev/reference.py on lines 55..55
pyha/cores/fft/fft_core/dev/reference.py on lines 56..56
pyha/cores/fft/fft_core/dev/reference.py on lines 58..58
pyha/cores/fft/fft_core/dev/reference.py on lines 61..61
pyha/cores/fft/fft_core/dev/reference.py on lines 62..62
pyha/cores/fft/fft_core/dev/reference.py on lines 63..63
pyha/cores/fft/fft_core/dev/reference.py on lines 64..64
pyha/cores/fft/fft_core/dev/reference.py on lines 67..67
pyha/cores/fft/fft_core/dev/reference.py on lines 68..68
pyha/cores/fft/fft_core/dev/reference.py on lines 69..69
pyha/cores/fft/fft_core/dev/reference.py on lines 70..70

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 43.

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 __init__ has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, val=0.0, left=None, right=None, overflow_style='wrap',
Severity: Major
Found in pyha/common/fixed_point.py - About 1 hr to fix

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

        def __init__(self, val=0.0 + 0.0j, left=0, right=-17, overflow_style='wrap', round_style='truncate',
    Severity: Major
    Found in pyha/common/complex.py - About 1 hr to fix

      Function np_to_py has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def np_to_py(array):
          """ Convert numpy to python recursively.
          For example float32 to float and ndarray to []
          """
          # https://github.com/numpy/numpy/issues/8052
      Severity: Minor
      Found in pyha/common/util.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 _pyha_enable_function_profiling_for_types has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def _pyha_enable_function_profiling_for_types(self):
              for k, v in self.__dict__.items():
                  if k == '_pyha_initial_self':
                      continue
                  if hasattr(v, '_pyha_update_registers'):
      Severity: Minor
      Found in pyha/common/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 __str__ has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          def __str__(self):
      
              # test if we are dealing with array appending ([a] + b)
              if self.value == '+':
                  if isinstance(self.first, ListNodeVHDL) or isinstance(self.second, ListNodeVHDL):
      Severity: Minor
      Found in pyha/conversion/redbaron_transforms.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

      Severity
      Category
      Status
      Source
      Language