Mon, 08 Jun 2020 08:17:14 +0200
Code Style Checker: started to implement checker for security related issues.
# -*- coding: utf-8 -*- # Copyright (c) 2020 Detlev Offenbach <detlev@die-offenbachs.de> # """ Package containing the various security checker modules. """ import collections _checkermodules = [ "blackListCalls", "blackListImports", ] def generateCheckersDict(): """ Function generate the dictionary with checkers. @return dictionary containing list of tuples with checker data @rtype dict """ checkersDict = collections.defaultdict(list) for checkerModule in _checkermodules: modName = "Security.Checks.{0}".format(checkerModule) try: mod = __import__(modName) components = modName.split('.') for comp in components[1:]: mod = getattr(mod, comp) except ImportError: continue if not hasattr(mod, "getChecks"): continue modCheckersDict = mod.getChecks() for checktype, check in modCheckersDict.items(): checkersDict[checktype].append(check) return checkersDict