Showing 1,422 of 1,425 total issues
Line too long (102/100) Open
latest_text = time.strftime('%Y-%m-%dT%H:%M:%SZ', self.get_field('LatestEndTime').timetuple())
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.
Unnecessary else
after raise
Open
if sfu == 'None':
- Read upRead up
- Exclude checks
Used in order to highlight an unnecessary block of code following an if containing a raise statement. As such, it will warn when it encounters an else following a chain of ifs, all of them containing a raise statement.
Too many statements (107/50) Open
def get_ur(self, withhold_dns=False):
- Read upRead up
- Exclude checks
Used when a function or method has too many statements. You should then split it in smaller functions / methods.
Too many branches (13/12) Open
def _check_fields(self):
- Read upRead up
- Exclude checks
Used when a function or method has too many branches, making it hard to follow.
Too many statements (71/50) Open
def get_ur(self):
- Read upRead up
- Exclude checks
Used when a function or method has too many statements. You should then split it in smaller functions / methods.
Wrong continued indentation (add 14 spaces). Open
" doesn't contain a datetime.")
- Read upRead up
- Exclude checks
TODO
doesn't contain a datetime.
)
^ |
Wrong continued indentation (add 13 spaces). Open
" doesn't contain an datetime.")
- Read upRead up
- Exclude checks
TODO
doesn't contain an datetime.
)
^ |
Constant name log
doesn't conform to UPPER_CASE naming style Open
log = logging.getLogger(LOGGER_ID)
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Using type() instead of isinstance() for a typecheck. Open
if type(value) == datetime:
- Read upRead up
- Exclude checks
The idiomatic way to perform an explicit typecheck in Python is to use isinstance(x, Y) rather than type(x) == Y, type(x) is Y. Though there are unusual situations where these give different results.
Too few public methods (1/2) Open
class Query(object):
- Read upRead up
- Exclude checks
Used when class has too few public methods, so be sure it's really worth it.
Variable name UR_OPEN
doesn't conform to snake_case naming style Open
UR_OPEN = ('<urf:UsageRecords xmlns:urf="http://eu-emi.eu/namespace'
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Line too long (103/100) Open
self._msg_fields = ["Site", "SubmitHost", "MachineName", "Queue", "LocalJobId", "LocalUserId",
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.
Too many instance attributes (9/7) Open
class JobRecord(Record):
- Read upRead up
- Exclude checks
Used when class has too many instance attributes, try to reduce this to get a simpler (and so easier to use) class.
Line too long (106/100) Open
earliest_text = time.strftime('%Y-%m-%dT%H:%M:%SZ', self.get_field('EarliestEndTime').timetuple())
- Read upRead up
- Exclude checks
Used when a line is longer than a given number of characters.
Missing module docstring Open
# Copyright 2014 The Science and Technology Facilities Council
- Read upRead up
- Exclude checks
Used when a module has no docstring.Empty modules do not require a docstring.
Wrong continued indentation (add 13 spaces). Open
" doesn't contain an integer.")
- Read upRead up
- Exclude checks
TODO
doesn't contain an integer.
)
^ |
Variable name e
doesn't conform to snake_case naming style Open
except ValueError as e:
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).
Too many branches (14/12) Open
def checked(self, name, value):
- Read upRead up
- Exclude checks
Used when a function or method has too many branches, making it hard to follow.
Class 'DbUnloader' inherits from object, can be safely removed from bases in python3 Open
class DbUnloader(object):
- Read upRead up
- Exclude checks
Used when a class inherit from object, which under python3 is implicit, hence can be safely removed from bases.
Variable name UR_CLOSE
doesn't conform to snake_case naming style Open
UR_CLOSE = '</urf:UsageRecords>'
- Read upRead up
- Exclude checks
Used when the name doesn't conform to naming rules associated to its type (constant, variable, class...).