app_helper/base_test.py
File base_test.py
has 566 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import os.path
import warnings
from collections import OrderedDict
from contextlib import contextmanager
from copy import deepcopy
Function create_pages
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
def create_pages(source, languages):
"""
Build pages according to the pages data provided by :py:meth:`get_pages_data`
and returns the list of the draft version of each
"""
- 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 _prepare_request
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def _prepare_request(self, request, page, user, lang, use_middlewares, use_toolbar=False, secure=False):
from importlib import import_module
from django.contrib.auth.models import AnonymousUser
- 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 request
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def request(
Function post_request
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def post_request(
Function create_user
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_user(
Function get_toolbar_request
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_toolbar_request(self, page, user, path=None, edit=False, lang="en", use_middlewares=False, secure=False):
Function get_request
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_request(self, page, lang, user=None, path=None, use_middlewares=False, secure=False, use_toolbar=False):
Function _prepare_request
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _prepare_request(self, request, page, user, lang, use_middlewares, use_toolbar=False, secure=False):
Function get_page_request
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_page_request(self, page, user, path=None, edit=False, lang="en", use_middlewares=False, secure=False):