fedspendingtransparency/usaspending-api

View on GitHub
usaspending_api/conftest.py

Summary

Maintainability
C
1 day
Test Coverage
B
82%

File conftest.py has 478 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import logging
import os
import sys
import tempfile
from pathlib import Path
Severity: Minor
Found in usaspending_api/conftest.py - About 7 hrs to fix

    Function django_db_setup has a Cognitive Complexity of 28 (exceeds 15 allowed). Consider refactoring.
    Open

    def django_db_setup(
        request,
        django_test_environment: None,
        django_db_blocker,
        django_db_use_migrations: bool,
    Severity: Minor
    Found in usaspending_api/conftest.py - About 2 hrs 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 django_db_setup has 8 arguments (exceeds 6 allowed). Consider refactoring.
    Open

    def django_db_setup(
    Severity: Major
    Found in usaspending_api/conftest.py - About 45 mins to fix

      There are no issues that match your filters.

      Category
      Status