Showing 7 of 7 total issues
File cfssl.py
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).
import requests
Function sign
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def sign(self, certificate_request, hosts=None, subject=None,
Function new_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def new_key(self, hosts, names, common_name=None, key=None, ca=None):
Function bundle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def bundle(self, certificate, private_key=None,
Function scan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def scan(self, host, ip=None, timeout=None, family=None, scanner=None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, org_name, org_unit, city, state, country):
Function _format_response_message
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def _format_response_message(error):
message = ''
if isinstance(error, dict):
message += (error['message'] if 'message' in error
else '<undefined message>')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"