failmap/admin

View on GitHub

Showing 267 of 577 total issues

Function get_impact has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def get_impact(severity):
    if severity["is_explained"]:
        return "good"
    return "high" if severity["high"] else "medium" if severity["medium"] else "low" if severity["low"] else "good"

Severity: Minor
Found in websecmap/scanners/impact.py - About 35 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

Function store has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def store(results, endpoint_id):

    resolves, can_connect_result, redirects_to_safety_result = results

    if not resolves:
Severity: Minor
Found in websecmap/scanners/scanner/plain_http.py - About 35 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

Function redirects_to_safety has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def redirects_to_safety(url: str):
    """
    Also includes the ip-version of the endpoint. Implies that the endpoint resolves.
    Any safety over any network is accepted now, both A and AAAA records.

Severity: Minor
Found in websecmap/scanners/scanner/http.py - About 35 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

Function store has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def store(result: dict, endpoint_id: int):
    """

    :param result: param endpoint:
    :param endpoint:
Severity: Minor
Found in websecmap/scanners/scanner/ftp.py - About 35 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

Function do_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def do_request(url, params={}, previous_items=[]):
    """Internal function, performs API requests and merges paginated data"""
    # default to max limit of API
    if "limit" not in params.keys():
        params["limit"] = 10000
Severity: Minor
Found in websecmap/api/apis/zorgkaart.py - About 35 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

Function match_organization has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def match_organization(openstreetmap_properties, country, organization_type):

    # in preferred order:
    attempted_properties = ["name", "official_name", "alt_name", "localname"]

Severity: Minor
Found in websecmap/map/logic/openstreetmap.py - About 35 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

Function recreate_organization_reports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def recreate_organization_reports(organizations: List[int]):
    """Remove organization rating and rebuild a new."""

    # todo: only for allowed organizations...

Severity: Minor
Found in websecmap/map/report.py - About 35 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

Function handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def handle(self, *args, **options):
        """Short hand for the first time running this"""

        if options["days"]:
            days = options["days"]
Severity: Minor
Found in websecmap/map/management/commands/custom_commands.py - About 35 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

Function get_severity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def get_severity(scan: Union[EndpointGenericScan, UrlGenericScan]) -> Dict[str, Any]:
    # Can be probably more efficient by adding some methods to scan.
    if not calculation_methods.get(scan.type, None):
        raise ValueError("No calculation available for this scan type: %s" % scan.type)

Severity: Minor
Found in websecmap/reporting/severity.py - About 35 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

Avoid too many return statements within this function.
Open

        return u
Severity: Major
Found in websecmap/organizations/models.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return False
    Severity: Major
    Found in websecmap/scanners/scanner/autoexplain_dutch_untrusted_cert.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return False
      Severity: Major
      Found in websecmap/scanners/scanner/http.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return analyze_soap_headers(endpoint_id)
        Severity: Major
        Found in websecmap/scanners/scanner/security_headers.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return clean_up_existing_headers(endpoint_id, service_type=service_type, reason="authentication_required")
          Severity: Major
          Found in websecmap/scanners/scanner/security_headers.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return
            Severity: Major
            Found in websecmap/organizations/models.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return False
              Severity: Major
              Found in websecmap/scanners/scanner/http.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return False
                Severity: Major
                Found in websecmap/scanners/scanner/autoexplain_dutch_untrusted_cert.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                  return True
                  Severity: Major
                  Found in websecmap/scanners/scanner/http.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return "UNKNOWN"
                    Severity: Major
                    Found in websecmap/scanners/scanner/security_headers.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return
                      Severity: Major
                      Found in websecmap/organizations/models.py - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language