Showing 22 of 22 total issues
Function rating_view
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def rating_view(request, area=settings.AREA_REGIONS) -> HttpResponse:
"""
Ratings view
:param request: django.http.HttpRequest
:param area: str
- 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 region_view
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def region_view(request) -> HttpResponse:
"""
Region Page representation
:param request: django.http.HttpRequest
:return: django.http.HttpResponse
- 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 visitor_request
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def visitor_request(request: HttpRequest) -> HttpResponse or FileResponse:
"""
Saves request
:param request: django.http.HttpRequest
:return: django.http.HttpResponse
- 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 update_map
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def update_map(tourism_type: str, home_area: str, *args, **kwargs) -> go.Figure:
"""
Updates the map
:param tourism_type: str
:param home_area: str
- 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 get_interest
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def get_interest(
region: str, home_area: str, interesant_area: str, tourism_type: str, id: int = 0
) -> models.QuerySet:
"""
Returns interest according to areas
- 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
File views.py
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import numpy as np
from django.conf import settings
from django.db import models
from django.http import HttpRequest
from django.http import HttpResponse
Function fill_geo_data
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def fill_geo_data(sender, instance, *args, **kwargs) -> None:
try:
from acesta_updater.management.commands.helpers.sight_helper import (
get_geo_data,
get_lon_lat,
- 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 update_period_info
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update_period_info(self, period, order_regions, tourism_types):
period_info = self.period_info
for region in order_regions.all():
region_period_data = {region.code: {}}
- 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 get_sizes
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_sizes(values: list, min_size: int = 10, max_size: int = 30) -> list:
"""
Returns dots sizes
:param values: list
:param min_size: int
- 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 post_login
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def post_login(
Function update_interest
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_interest(
Function update_audience_key
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_audience_key(
Function extract_common_fields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_common_fields(self, data):
common_fields = {}
user_data = data.get("Data")
if user_data:
common_fields.update(
- 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 get_interest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_interest(
Function update_title
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_title(
Function update_title
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update_title(
home_area: str, map_data: dict, current_state: str, *args, **kwargs
) -> str:
"""
Updates the app title
- 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 clean_up_old_periods
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def clean_up_old_periods(self):
old_periods = []
for region, period in self.period_info.items():
end_date = get_date(period.get("end"))
if end_date < now():
- 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 updateSplitter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function updateSplitter() {
if (typeof splitter !== "undefined") {
if (window.innerWidth >= 992) {
splitter.refresh();
} else {
- 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 get_ppt_monitor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_ppt_monitor(queries_data, kwargs) -> dict:
"""
Returns Popularity monitor
:param queries_data: list
:param kwargs: dict
- 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 get_prop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_prop(obj, key):
if isinstance(obj, dict):
return obj.get(key) or obj.get(key.lower())
elif obj and isinstance(obj, object):
return getattr(obj, key) or getattr(obj, key.lower())
- 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"