maestro-server/analytics-maestro

View on GitHub
app/libs/template/symbolAssets.py

Summary

Maintainability
A
35 mins
Test Coverage
F
26%

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

    def asset(self, asset, template, pos, size, opts={}):
Severity: Minor
Found in app/libs/template/symbolAssets.py - About 35 mins to fix

    Line too long (99 > 79 characters)
    Open

        def __init__(self, draw, path='%s/assets/symbol/', assets=LoadTemplates, manager=ManageAssets):
    Severity: Minor
    Found in app/libs/template/symbolAssets.py by pep8

    Limit all lines to a maximum of 79 characters.

    There are still many devices around that are limited to 80 character
    lines; plus, limiting windows to 80 characters makes it possible to
    have several windows side-by-side.  The default wrapping on such
    devices looks ugly.  Therefore, please limit all lines to a maximum
    of 79 characters. For flowing long blocks of text (docstrings or
    comments), limiting the length to 72 characters is recommended.
    
    Reports error E501.

    No newline at end of file
    Open

            return self.use_symbol(asset, pos, opts)
    Severity: Minor
    Found in app/libs/template/symbolAssets.py by pep8

    Trailing blank lines are superfluous.

    Okay: spam(1)
    W391: spam(1)\n
    
    However the last line should end with a new line (warning W292).

    Test for membership should be 'not in'
    Open

            if not asset in self._s_basket:
    Severity: Minor
    Found in app/libs/template/symbolAssets.py by pep8

    Negative comparison should be done using "not in" and "is not".

    Okay: if x not in y:\n    pass
    Okay: assert (X in Y or X is Z)
    Okay: if not (X in Y):\n    pass
    Okay: zz = x is not y
    E713: Z = not X in Y
    E713: if not X.B in Y:\n    pass
    E714: if not X is Y:\n    pass
    E714: Z = not X.B is Y

    Test for membership should be 'not in'
    Open

            if not asset in self._s_basket:
    Severity: Minor
    Found in app/libs/template/symbolAssets.py by pep8

    Negative comparison should be done using "not in" and "is not".

    Okay: if x not in y:\n    pass
    Okay: assert (X in Y or X is Z)
    Okay: if not (X in Y):\n    pass
    Okay: zz = x is not y
    E713: Z = not X in Y
    E713: if not X.B in Y:\n    pass
    E714: if not X is Y:\n    pass
    E714: Z = not X.B is Y

    There are no issues that match your filters.

    Category
    Status