LasLabs/python-cfssl

View on GitHub

Showing 7 of 7 total issues

File cfssl.py has 384 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License MIT (https://opensource.org/licenses/MIT).

import requests
Severity: Minor
Found in cfssl/cfssl.py - About 5 hrs to fix

    Function sign has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def sign(self, certificate_request, hosts=None, subject=None,
    Severity: Minor
    Found in cfssl/cfssl.py - About 45 mins to fix

      Function new_key has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def new_key(self, hosts, names, common_name=None, key=None, ca=None):
      Severity: Minor
      Found in cfssl/cfssl.py - About 35 mins to fix

        Function bundle has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def bundle(self, certificate, private_key=None,
        Severity: Minor
        Found in cfssl/cfssl.py - About 35 mins to fix

          Function scan has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def scan(self, host, ip=None, timeout=None, family=None, scanner=None):
          Severity: Minor
          Found in cfssl/cfssl.py - About 35 mins to fix

            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(self, org_name, org_unit, city, state, country):
            Severity: Minor
            Found in cfssl/models/subject_info.py - About 35 mins to fix

              Function _format_response_message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _format_response_message(error):
                      message = ''
                      if isinstance(error, dict):
                          message += (error['message'] if 'message' in error
                                      else '<undefined message>')
              Severity: Minor
              Found in cfssl/cfssl.py - About 25 mins to fix

              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"

              Further reading

              Severity
              Category
              Status
              Source
              Language