q-optimize/c3

View on GitHub
c3/libraries/constants.py

Summary

Maintainability
A
0 mins
Test Coverage

Correct one of the identical sub-expressions on both sides of operator "@".
Invalid

    "C16": x90p @ x90p @ y90m,
Severity: Major
Found in c3/libraries/constants.py by sonar-python

Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.

This rule ignores *, +, and =.

Noncompliant Code Example

if a == a: # Noncompliant
    work()

if  a != a: # Noncompliant
    work()

if  a == b and a == b: # Noncompliant
    work()

if a == b or a == b: # Noncompliant
    work()

j = 5 / 5 # Noncompliant
k = 5 - 5 # Noncompliant

Exceptions

The following are ignored:

  • The expression 1 << 1

See

  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect
  • {rule:python:S1656} - Implements a check on =.

Correct one of the identical sub-expressions on both sides of operator "@".
Invalid

    "C13": y90p @ y90p,
Severity: Major
Found in c3/libraries/constants.py by sonar-python

Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.

This rule ignores *, +, and =.

Noncompliant Code Example

if a == a: # Noncompliant
    work()

if  a != a: # Noncompliant
    work()

if  a == b and a == b: # Noncompliant
    work()

if a == b or a == b: # Noncompliant
    work()

j = 5 / 5 # Noncompliant
k = 5 - 5 # Noncompliant

Exceptions

The following are ignored:

  • The expression 1 << 1

See

  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect
  • {rule:python:S1656} - Implements a check on =.

Correct one of the identical sub-expressions on both sides of operator "@".
Invalid

    "C17": y90p @ y90p @ x90p,
Severity: Major
Found in c3/libraries/constants.py by sonar-python

Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.

This rule ignores *, +, and =.

Noncompliant Code Example

if a == a: # Noncompliant
    work()

if  a != a: # Noncompliant
    work()

if  a == b and a == b: # Noncompliant
    work()

if a == b or a == b: # Noncompliant
    work()

j = 5 / 5 # Noncompliant
k = 5 - 5 # Noncompliant

Exceptions

The following are ignored:

  • The expression 1 << 1

See

  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect
  • {rule:python:S1656} - Implements a check on =.

Correct one of the identical sub-expressions on both sides of operator "@".
Invalid

    "C23": y90p @ y90p @ x90m,
Severity: Major
Found in c3/libraries/constants.py by sonar-python

Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.

This rule ignores *, +, and =.

Noncompliant Code Example

if a == a: # Noncompliant
    work()

if  a != a: # Noncompliant
    work()

if  a == b and a == b: # Noncompliant
    work()

if a == b or a == b: # Noncompliant
    work()

j = 5 / 5 # Noncompliant
k = 5 - 5 # Noncompliant

Exceptions

The following are ignored:

  • The expression 1 << 1

See

  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect
  • {rule:python:S1656} - Implements a check on =.

Correct one of the identical sub-expressions on both sides of operator "@".
Invalid

    "C7": x90p @ x90p,
Severity: Major
Found in c3/libraries/constants.py by sonar-python

Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.

This rule ignores *, +, and =.

Noncompliant Code Example

if a == a: # Noncompliant
    work()

if  a != a: # Noncompliant
    work()

if  a == b and a == b: # Noncompliant
    work()

if a == b or a == b: # Noncompliant
    work()

j = 5 / 5 # Noncompliant
k = 5 - 5 # Noncompliant

Exceptions

The following are ignored:

  • The expression 1 << 1

See

  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect
  • {rule:python:S1656} - Implements a check on =.

Correct one of the identical sub-expressions on both sides of operator "@".
Open

    "C4": x90p @ x90p @ y90p,
Severity: Major
Found in c3/libraries/constants.py by sonar-python

Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.

This rule ignores *, +, and =.

Noncompliant Code Example

if a == a: # Noncompliant
    work()

if  a != a: # Noncompliant
    work()

if  a == b and a == b: # Noncompliant
    work()

if a == b or a == b: # Noncompliant
    work()

j = 5 / 5 # Noncompliant
k = 5 - 5 # Noncompliant

Exceptions

The following are ignored:

  • The expression 1 << 1

See

  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect
  • {rule:python:S1656} - Implements a check on =.

Correct one of the identical sub-expressions on both sides of operator "@".
Open

    "C19": y90p @ y90p @ x90p @ x90p,
Severity: Major
Found in c3/libraries/constants.py by sonar-python

Using the same value on either side of a binary operator is almost always a mistake. In the case of logical operators, it is either a copy/paste error and therefore a bug, or it is simply wasted code, and should be simplified. In the case of bitwise operators and most binary mathematical operators, having the same value on both sides of an operator yields predictable results, and should be simplified.

This rule ignores *, +, and =.

Noncompliant Code Example

if a == a: # Noncompliant
    work()

if  a != a: # Noncompliant
    work()

if  a == b and a == b: # Noncompliant
    work()

if a == b or a == b: # Noncompliant
    work()

j = 5 / 5 # Noncompliant
k = 5 - 5 # Noncompliant

Exceptions

The following are ignored:

  • The expression 1 << 1

See

  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect
  • {rule:python:S1656} - Implements a check on =.

There are no issues that match your filters.

Category
Status