Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def analyze(self, oFile):
for iLineNumber, oLine in enumerate(oFile.lines):
if not self._is_vsg_off(oLine):
if oLine.isSensitivityListBegin and oLine.isSensitivityListEnd:
continue
if oLine.insideSensitivityList:
if oLine.isSensitivityListBegin:
iAlignmentColumn = oLine.line.find('(')
elif oLine.isSensitivityListEnd and re.match('^\s*\)', oLine.line):
continue
else:
check.multiline_alignment(self, iAlignmentColumn + 1, oLine, iLineNumber)
if oLine.isIfKeyword and oLine.isThenKeyword:
continue
if oLine.isElseIfKeyword and oLine.isThenKeyword:
continue
if oLine.isIfKeyword:
if re.match('^\s+if\s\(', oLine.lineLower):
iAlignmentColumn = oLine.lineLower.find('(')
fCheckAlignment = True
continue # pragma: no cover
if oLine.isElseIfKeyword:
if re.match('^\s+elsif\s\(', oLine.lineLower):
iAlignmentColumn = oLine.lineLower.find('(')
fCheckAlignment = True
continue # pragma: no cover
if oLine.insideIf and fCheckAlignment:
check.multiline_alignment(self, iAlignmentColumn + 1, oLine, iLineNumber)
if oLine.isThenKeyword:
fCheckAlignment = False
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.isElseKeyword and not oLine.isIfKeyword:
check.is_no_blank_line_before(self, oFile, iLineNumber, 'isEndCaseKeyword')
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.__dict__[self.sTrigger] and check.has_package_name(oLine):
check.is_uppercase(self, check.get_package_name(oLine), iLineNumber)
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.isElseKeyword:
check.indent_of_comments_above(self, oFile, iLineNumber)
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.isCaseWhenKeyword:
check.indent_of_comments_above(self, oFile, iLineNumber)
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.isElseIfKeyword:
check.indent_of_comments_above(self, oFile, iLineNumber)
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.isEndIfKeyword and not oLine.isIfKeyword:
check.is_no_blank_line_before(self, oFile, iLineNumber, 'isEndCaseKeyword')
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.__dict__[self.sTrigger]:
check.is_no_space_after(self, self.sWord, oLine, iLineNumber)
def _analyze(self, oFile, oLine, iLineNumber):
if oLine.isGenericKeyword and not self.fGroupFound and not oLine.isGenericDeclaration:
self.fGroupFound = True
self.iStartGroupIndex = iLineNumber
if oLine.isEndGenericMap and self.fGroupFound:
self.lGroup.append(oLine)
self.fGroupFound = False
check.keyword_alignment(self, self.iStartGroupIndex, ':', self.lGroup)
self.lGroup = []
self.iStartGroupIndex = None
if self.fGroupFound:
if oLine.isGenericDeclaration:
self.lGroup.append(oLine)
else:
self.lGroup.append(line.line('Removed line'))