tasks.py
File tasks.py
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import os
import base64
import logging
import platform
from datetime import date, timedelta
Function migrate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def migrate(migration, sources=None, kwargs_string=None, dry=True, async=False, group_size=1000):
Function migrate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def migrate(migration, sources=None, kwargs_string=None, dry=True, async=False, group_size=1000):
''' Task to run a migration.
:param migration: The migration function to run. This is passed in
as a string then interpreted as a function by the invoke task.
- 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"
Further reading
Function test
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def test(cov=True, doctests=True, verbose=False, debug=False, pdb=False):
Function harvesters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def harvesters(async=False, start=None, end=None):
''' Runs all harvesters '''
from scrapi import settings
settings.CELERY_ALWAYS_EAGER = not async
from scrapi import registry
- 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"