pygae/galgebra

View on GitHub

Showing 899 of 899 total issues

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Open

        assert not isinstance(other, Pdop)
Severity: Info
Found in galgebra/dop.py by bandit

Starting a process with a partial executable path
Open

            subprocess.call(['pdfcrop', pdf_filename])
Severity: Info
Found in galgebra/gprinter.py by bandit

Starting a process with a partial executable path
Open

            subprocess.call(['Pdf2Png', rootfilename])
Severity: Info
Found in galgebra/gprinter.py by bandit

Starting a process with a shell, possible injection detected, security issue.
Open

            os.system(pdfprog + ' ' + filename[:-4] + sys_cmd['null'])
Severity: Major
Found in galgebra/printer.py by bandit

Use of possibly insecure function - consider using safer ast.literal_eval.
Open

        eval(input('!!!!Return to continue!!!!\n'))
Severity: Minor
Found in galgebra/printer.py by bandit

Starting a process with a partial executable path
Open

            subprocess.call(['mv', rootfilename+'-crop.pdf', pdf_filename])
Severity: Info
Found in galgebra/gprinter.py by bandit

Starting a process with a shell, possible injection detected, security issue.
Open

        os.system(print_cmd)
Severity: Major
Found in galgebra/printer.py by bandit

Starting a process with a shell, possible injection detected, security issue.
Open

            os.system(sys_cmd['rm'] + ' ' + filename[:-4] + '.aux ' + filename[:-4] + '.log')
Severity: Major
Found in galgebra/printer.py by bandit

Take the required action to fix the issue indicated by this "FIXME" comment.
Open

# FIXME This outputs incorrectly, the scalar part 3 is missing
Severity: Major
Found in doc/python/Dop.py by sonar-python

FIXME tags are commonly used to mark places where a bug is suspected, but which the developer wants to deal with later.

Sometimes the developer will not have the time or will simply forget to get back to that tag.

This rule is meant to track those tags and to ensure that they do not go unnoticed.

Noncompliant Code Example

def divide(numerator, denominator):
  return numerator / denominator              # FIXME denominator value might be 0

See

Refactor this function to reduce its Cognitive Complexity from 33 to the 15 allowed.
Open

    def __init__(self, __u, __coords, *, ga, norm=False, name=None, root='e', debug=False):
Severity: Critical
Found in galgebra/ga.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
Open

    def __init__(self, f, Ga, nargs=None, fct=False):
Severity: Critical
Found in galgebra/lt.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Remove this commented out code.
Open

            # print 'D0, term, dc, pd =', D0, term, dc, pd
Severity: Major
Found in galgebra/dop.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Either merge this branch with the identical one on line "1130" or change one of the implementations.
Open

                obj = diff(self.obj, coord)
Severity: Major
Found in galgebra/mv.py by sonar-python

Having two branches in the same if structure with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.

Noncompliant Code Example

if 0 <= a < 10:
    do_the_thing()
elif 10 <= a < 20:
    do_the_other_thing()
elif 20 <= a < 50:
    do_the_thing()  # Noncompliant; duplicates first condition
else:
    do_the_rest()

b = 4 if a > 12 else 4

Compliant Solution

if (0 <= a < 10) or (20 <= a < 50):
    do_the_thing()
elif 10 <= a < 20:
    do_the_other_thing()
else:
    do_the_rest()

b = 4

or

if 0 <= a < 10:
    do_the_thing()
elif 10 <= a < 20:
    do_the_other_thing()
elif 20 <= a < 50:
    do_the_third_thing()
else:
    do_the_rest()

b = 8 if a > 12 else 4

Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed.
Open

    def characterise_Mv(self) -> None:
Severity: Critical
Found in galgebra/mv.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 41 to the 15 allowed.
Open

    def _print_Pow(self, expr):
Severity: Critical
Found in galgebra/printer.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 30 to the 15 allowed.
Open

def Fmt(obj, fmt=0):
Severity: Critical
Found in galgebra/printer.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Remove this commented out code.
Open

# nbsphinx_execute = 'always'
Severity: Major
Found in doc/conf.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Remove this commented out code.
Open

# source_parsers = {
Severity: Major
Found in doc/conf.py by sonar-python

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
Open

    def r_basis(self) -> List[Expr]:
Severity: Critical
Found in galgebra/ga.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 24 to the 15 allowed.
Open

    def Dop_mv_expand(self, modes=None) -> List[Tuple[Expr, Expr]]:
Severity: Critical
Found in galgebra/mv.py by sonar-python

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Severity
Category
Status
Source
Language