petspats/pyha

View on GitHub

Showing 164 of 164 total issues

Function convert_input_types has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def convert_input_types(args, to_types=None, silence=False):
    if not silence:
        logger.info(f'Converting simulation inputs to hardware types...')

    def convert_arg(default_type, arg, i):
Severity: Minor
Found in pyha/simulation/simulation_interface.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 2 locations. Consider refactoring.
Open

    inp = (np.random.uniform(-1, 1, size=1280) + np.random.uniform(-1, 1, size=1280) * 1j) * input_power
Severity: Major
Found in pyha/cores/fft/fft_power/fft_power.py and 1 other location - About 1 hr to fix
pyha/cores/fft/fft_power/fft_power.py on lines 60..60

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

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 2 locations. Consider refactoring.
Open

            if x < 0.0 and y > 0.0:
                # vector in II quadrant -> initial shift by PI to IV quadrant (mirror)
                self.x[0] = -x
                self.y[0] = -y
                self.phase[0] = 1.0
Severity: Major
Found in pyha/cores/cordic/core.py and 1 other location - About 1 hr to fix
pyha/cores/cordic/core.py on lines 57..61

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

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 2 locations. Consider refactoring.
Open

            elif x < 0.0 and y < 0.0:
                # vector in III quadrant -> initial shift by -PI to I quadrant (mirror)
                self.x[0] = -x
                self.y[0] = -y
                self.phase[0] = -1.0
Severity: Major
Found in pyha/cores/cordic/core.py and 1 other location - About 1 hr to fix
pyha/cores/cordic/core.py on lines 51..55

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

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 2 locations. Consider refactoring.
Open

                self.y[i + 1] = self.y[i] + (self.x[i] >> i)
Severity: Major
Found in pyha/cores/cordic/core.py and 1 other location - About 1 hr to fix
pyha/cores/cordic/core.py on lines 82..82

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

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 2 locations. Consider refactoring.
Open

                self.y[i + 1] = self.y[i] - (self.x[i] >> i)
Severity: Major
Found in pyha/cores/cordic/core.py and 1 other location - About 1 hr to fix
pyha/cores/cordic/core.py on lines 78..78

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

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 2 locations. Consider refactoring.
Open

                self.x[i + 1] = self.x[i] + (self.y[i] >> i)
Severity: Major
Found in pyha/cores/cordic/core.py and 1 other location - About 1 hr to fix
pyha/cores/cordic/core.py on lines 79..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 47.

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

def transform_unroll_local_constructor(red_node):
    assigns = red_node.find_all('assign')
    for node in assigns:
        call = node.value.call
        if call is None:  # has no function call
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

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

                self.x[i + 1] = self.x[i] - (self.y[i] >> i)
Severity: Major
Found in pyha/cores/cordic/core.py and 1 other location - About 1 hr to fix
pyha/cores/cordic/core.py on lines 83..83

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

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

    def update_input_types(self, args, kwargs):
        if self.arg_types is None:
            self.arg_types = list(args)
        else:
            for i, v in enumerate(args):
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 __deepcopy__ has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def __deepcopy__(self, memo):
        cls = self.__class__
        result = cls.__new__(cls)
        memo[id(self)] = result

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

    def get_sorted_traces(cls):
        class Tmp:
            def __init__(self, data_model, data_pyha, label, time):
                self.type = type
                self.data_model = data_model
Severity: Minor
Found in pyha/simulation/tracer.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 __init__ has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, red_node, parent=None):
        self.red_node = red_node
        self.parent = parent
        self.target = None
        self.value = None
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

Function _pyha_floats_to_fixed has a Cognitive Complexity of 13 (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
        # update atoms
        for k, v in self.__dict__.items():
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

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

        out1[4], out1[6] = butterfly(out0[4], out0[6], 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 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[0], out0[1] = butterfly(inp[0], inp[1], W(0, 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 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

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

        out2[1], out2[5] = butterfly(out1[1], out1[5], 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 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[0], out2[4] = butterfly(out1[0], out1[4], 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 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[1], out1[3] = butterfly(out0[1], out0[3], W(0, 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 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, 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 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

Severity
Category
Status
Source
Language