Showing 1,557 of 1,564 total issues

Specify string format arguments as logging function parameters
Open

        log.info('Site: %s; batch system: %s' % (self.site_name, self.machine_name))
Severity: Minor
Found in apel/parsers/htcondor.py by pylint

Used when a logging statement has a call form of logging.<logging method>(format_string % (format_args...)). Such calls should leave string interpolation to the logging method itself and be written logging.<logging method>(format_string, format_args...) so that the program may avoid incurring the cost of the interpolation in those cases in which no message will be logged. For more, see http://www.python.org/dev/peps/pep-0282/.

Import from .parser import Parser should be placed at the top of the module
Open

from .parser import Parser
Severity: Info
Found in apel/parsers/__init__.py by pylint

Used when code and imports are mixed

Variable name rc doesn't conform to snake_case naming style
Open

        rc = {}
Severity: Info
Found in apel/parsers/pbs.py by pylint

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

Exactly one space required after comma
Open

from .datetime_utils import valid_from,valid_until, parse_timestamp, parse_time, iso2seconds
Severity: Info
Found in apel/common/__init__.py by pylint

Used when a wrong number of spaces is used around an operator, bracket or block opener. from .datetimeutils import validfrom,validuntil, parsetimestamp, parse_time, iso2seconds ^

Missing function or method docstring
Open

def set_up_logging(logfile, level, console):
Severity: Info
Found in apel/common/__init__.py by pylint

Used when a function or method has no docstring.Some special methods like init do not require a docstring.

Variable name tb doesn't conform to snake_case naming style
Open

    for tb in tbstack[1:]:
Severity: Info
Found in apel/common/exceptions.py by pylint

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

Cyclic import (apel.db.records -> apel.db.records.group_attribute)
Open

"""A setup script for APEL.
Severity: Info
Found in setup.py by pylint

Used when a cyclic import between two or more modules is detected.

Cyclic import (apel.db.records -> apel.db.records.normalised_summary)
Open

"""A setup script for APEL.
Severity: Info
Found in setup.py by pylint

Used when a cyclic import between two or more modules is detected.

Cyclic import (apel.parsers -> apel.parsers.pbs)
Open

"""A setup script for APEL.
Severity: Info
Found in setup.py by pylint

Used when a cyclic import between two or more modules is detected.

Variable name d doesn't conform to snake_case naming style
Open

    d = xml.dom.minidom.parseString(msg_text)
Severity: Info
Found in apel/db/loader/xml_parser.py by pylint

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

Constant name log doesn't conform to UPPER_CASE naming style
Open

log = logging.getLogger(__name__)
Severity: Info
Found in apel/parsers/parser.py by pylint

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

Exactly one space required after comma
Open

        parts = [x.split('=',1) for x in [y for y in self.LINE_EXPR.split(line) if len(y) > 1]]
Severity: Info
Found in apel/parsers/blah.py by pylint

Used when a wrong number of spaces is used around an operator, bracket or block opener. parts = [x.split('=',1) for x in [y for y in self.LINE_EXPR.split(line) if len(y) > 1]] ^

standard import import logging should be placed before from apel.common import parse_time
Open

import logging
Severity: Info
Found in apel/parsers/slurm.py by pylint

Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

Constant name logger doesn't conform to UPPER_CASE naming style
Open

logger = logging.getLogger(__name__)
Severity: Info
Found in apel/parsers/pbs.py by pylint

Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).

standard import import logging should be placed before from .datetime_utils import valid_from, valid_until, parse_timestamp, parse_time, iso2seconds
Open

import logging
Severity: Info
Found in apel/common/__init__.py by pylint

Used when PEP8 import order is not respected (standard imports first, then third-party libraries, then local imports)

Cyclic import (apel.db -> apel.db.apeldb)
Open

"""A setup script for APEL.
Severity: Info
Found in setup.py by pylint

Used when a cyclic import between two or more modules is detected.

Cyclic import (apel.db -> apel.db.apeldb -> apel.db.backends.mysql -> apel.db.records -> apel.db.records.blahd -> apel.db.records.record)
Open

"""A setup script for APEL.
Severity: Info
Found in setup.py by pylint

Used when a cyclic import between two or more modules is detected.

Cyclic import (apel.db.records -> apel.db.records.summary)
Open

"""A setup script for APEL.
Severity: Info
Found in setup.py by pylint

Used when a cyclic import between two or more modules is detected.

Cyclic import (apel.parsers -> apel.parsers.blah)
Open

"""A setup script for APEL.
Severity: Info
Found in setup.py by pylint

Used when a cyclic import between two or more modules is detected.

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

                rmem = node.firstChild.data
Severity: Major
Found in apel/db/loader/car_parser.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
Severity
Category
Status
Source
Language