Cyclic import (apel.db.records -> apel.db.records.summary) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
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.record) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db.records -> apel.db.records.sync) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db -> apel.db.apeldb -> apel.db.backends.mysql) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
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.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Similar lines in 2 files Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==apel.db.records.cloud:73 ==apel.db.records.job:93 role, group, vo = parsefqan(self.record_content['FQAN']) # We can't / don't put NULL in the database, so we use 'None' if role is None: role = 'None' if group is None: group = 'None' if vo is None: vo = 'None'
Similar lines in 2 files Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==apel.db.records.normalised_summary:191 ==apel.db.records.summary:186 ur.appendChild(infra)
earliest = doc.createElement('aur:EarliestEndTime') earliesttext = time.strftime('%Y-%m-%dT%H:%M:%SZ', self.getfield('EarliestEndTime').timetuple()) earliest.appendChild(doc.createTextNode(earliest_text)) ur.appendChild(earliest)
latest = doc.createElement('aur:LatestEndTime') latesttext = time.strftime('%Y-%m-%dT%H:%M:%SZ', self.getfield('LatestEndTime').timetuple()) latest.appendChild(doc.createTextNode(latest_text)) ur.appendChild(latest)
wall = doc.createElement('aur:WallDuration') wall.appendChild(doc.createTextNode('PT'+str(self.get_field('WallDuration'))+'S')) ur.appendChild(wall)
cpu = doc.createElement('aur:CpuDuration') cpu.appendChild(doc.createTextNode('PT'+str(self.get_field('CpuDuration'))+'S')) ur.appendChild(cpu)
Cyclic import (apel.db.records -> apel.db.records.processed) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db.records -> apel.db.records.storage) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db.records -> apel.db.records.cloud_summary) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.parsers -> apel.parsers.lsf) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.parsers -> apel.parsers.slurm) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
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.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.parsers -> apel.parsers.sge) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db -> apel.db.apeldb) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
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.
- Read upRead up
- Exclude checks
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.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.parsers -> apel.parsers.htcondor) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Similar lines in 2 files Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==apel.db.records.normalisedsummary:70 ==apel.db.records.summary:64 def _checkfields(self): ''' Add extra checks to the ones in the parent class. '''
# Call the parent's checks first. Record.checkfields(self)
# shorthand rc = self.recordcontent
monthstart = None monthend = None # For storing the month and year for the subsequent month. nextmonthyear = None next_month = None
try: # A bit convoluted for finding the first second in the next month. if (int(rc['Month']) == 12): nextmonthyear = int(rc['Year']) + 1 nextmonth = 1 else: nextmonthyear = int(rc['Year']) nextmonth = int(rc['Month']) + 1
monthstart = datetime(int(rc['Year']), int(rc['Month']), 1) monthend = datetime(nextmonthyear, next_month, 1)
Similar lines in 2 files Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==apel.db.records.normalisedsummary:135 ==apel.db.records.summary:130 def getur(self): ''' Returns the NormalisedSummaryRecord in AUR format. See https://twiki.cern.ch/twiki/bin/view/EMI/ComputeAccounting
Namespace information is written only once per record, by dbunloader. ''' # Create the document directly doc = Document() ur = doc.createElement('aur:SummaryRecord')
site = doc.createElement('aur:Site') site.appendChild(doc.createTextNode(self.get_field('Site'))) ur.appendChild(site)
month = doc.createElement('aur:Month') month.appendChild(doc.createTextNode(str(self.get_field('Month')))) ur.appendChild(month)
year = doc.createElement('aur:Year') year.appendChild(doc.createTextNode(str(self.get_field('Year')))) ur.appendChild(year)
user_id = doc.createElement('aur:UserIdentity')
if self.getfield('urf:GlobalUserName') is not None: globalusername = doc.createElement('urf:GlobalUserName') globalusername.appendChild(doc.createTextNode(self.getfield('GlobalUserName'))) globalusername.setAttribute('urf:type', 'opensslCompat') userid.appendChild(globaluser_name)
if self.getfield('urf:Group') is not None: group = doc.createElement('urf:Group') group.appendChild(doc.createTextNode(self.getfield('VO'))) user_id.appendChild(group)
if self.getfield('VOGroup') is not None: vogroup = doc.createElement('urf:GroupAttribute') vogroup.setAttribute('urf:type', 'vo-group') vogroup.appendChild(doc.createTextNode(self.getfield('VOGroup'))) user_id.appendChild(vogroup)
if self.getfield('VORole') is not None: vorole = doc.createElement('urf:GroupAttribute') vorole.setAttribute('urf:type', 'vo-role') vorole.appendChild(doc.createTextNode(self.getfield('VORole'))) user_id.appendChild(vorole)
ur.appendChild(user_id)
subhost = doc.createElement('aur:SubmitHost') subhost.appendChild(doc.createTextNode(str(self.get_field('SubmitHost')))) ur.appendChild(subhost)
infra = doc.createElement('aur:Infrastructure')
Similar lines in 2 files Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication.
==apel.db.records.normalisedsummary:104
==apel.db.records.summary:103
try:
earliestend = rc['EarliestEndTime']
latestend = rc['LatestEndTime']
if not (monthstart <= earliestend <= monthend):
raise InvalidRecordException(EarliestEndTime is not within stated month.
)
if not (monthstart <= latestend <= month_end):
raise InvalidRecordException(LatestEndTime is not within stated month.
)
if earliestend > latestend:
raise InvalidRecordException(LatestEndTime is earlier than EarliestEndTime.
)
except TypeError:
# These two fields are not compulsory.
pass
# Check that the month isn't in the future
now = datetime.now()
if month_start > now:
raise InvalidRecordException(Month specified in record is in the future.
)
if not 1 <= int(self.recordcontent['Month']) <= 12:
raise InvalidRecordException(Month value is out of range
)
if int(self.recordcontent['WallDuration']) < 0:
raise InvalidRecordException(Negative WallDuration
)
if int(self.recordcontent['CpuDuration']) < 0:
Cyclic import (apel.db.records -> apel.db.records.event) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db.records -> apel.db.records.cloud) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db.records -> apel.db.records.job) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Cyclic import (apel.db.records -> apel.db.records.group_attribute) Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Used when a cyclic import between two or more modules is detected.
Similar lines in 3 files Open
"""A setup script for APEL.
- Read upRead up
- Exclude checks
Indicates that a set of similar lines has been detected among multiple file. This usually means that the code should be refactored to avoid this duplication. ==apel.db.records.job:220 ==apel.db.records.normalisedsummary:171 ==apel.db.records.summary:166 if self.getfield('VOGroup') is not None: vogroup = doc.createElement('urf:GroupAttribute') vogroup.setAttribute('urf:type', 'vo-group') vogroup.appendChild(doc.createTextNode(self.getfield('VOGroup'))) userid.appendChild(vogroup)
if self.getfield('VORole') is not None: vorole = doc.createElement('urf:GroupAttribute') vorole.setAttribute('urf:type', 'vo-role') vorole.appendChild(doc.createTextNode(self.getfield('VORole'))) user_id.appendChild(vorole)
Line too long (83 > 79 characters) Open
_install_requires = ['mysqlclient', 'iso8601', 'python-ldap', 'dirq', 'future']
- Read upRead up
- Exclude checks
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.