ajenti / ajenti

Function with cyclomatic complexity higher than threshold PY-R1000
Anti-pattern
Minor
6 months ago6 months old
detect_platform has a cyclomatic complexity of 16 with "high" risk
 74def detect_python():
 75    return pyplatform.python_version()
 76
 77def detect_platform(): 78    base_mapping = {
 79        'gentoo base system': 'gentoo',
 80        'centos linux': 'centos',
HttpContext.file has a cyclomatic complexity of 19 with "high" risk
345
346        return compressed
347
348    def file(self, path, stream=False, inline=False, name=None):349        """
350        Returns a GZip compressed response with content of file located in ``path`` and correct headers
351
ResourcesHandler.handle_build has a cyclomatic complexity of 20 with "high" risk
 40
 41    @get(r'/resources/all\.(?P<group>.+)')
 42    @endpoint(page=True, auth=False)
 43    def handle_build(self, http_context, group=None): 44        """
 45        Deliver all extern resources for the current page.
 46
PluginManager.load_all_from has a cyclomatic complexity of 31 with "very-high" risk
258            if self[plugin]['imported']:
259                yield self[plugin]['info']['name']
260
261    def load_all_from(self, providers):262        """
263        Loads all plugins provided by given providers.
264
GateMiddleware.handle has a cyclomatic complexity of 21 with "high" risk
162            if not session.is_dead():
163                session.gate.send_sessionlist()
164
165    def handle(self, http_context):166        start_time = time.time()
167
168        self.vacuum()