Showing 137 of 185 total issues
Function login
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def login(request, redirect_to="/"):
form = forms.LoginForm(request=request)
error_msg = _("Invalid email or password")
next_url = request.GET.get("next", redirect_to)
fast = request.GET.get("fast", "false") == "true" or "fast" in request.GET
- 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 show_votes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def show_votes(votes, method="pca", display=True, title=None, labels=None, legend=None, **kwargs):
"""
Show votes dataset in a 2D plot.
"""
- 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 create_stereotype_coords
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def create_stereotype_coords(conversation, table, comments: list, transformer: Callable, kwargs: dict):
if apps.is_installed("ej_clusters") and getattr(conversation, "clusterization", None):
from ej_clusters.models import Stereotype
labels = conversation.clusterization.clusters.all().dataframe("name", index="users")
- 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 collect
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def collect(ctx, theme=None):
"""
Runs Django's collectstatic command
"""
theme, root = set_theme(theme)
- 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 user_statistics
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def user_statistics(
Function comment_statistics
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def comment_statistics(
Function show_votes
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def show_votes(votes, method="pca", display=True, title=None, labels=None, legend=None, **kwargs):
Function votes_table
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def votes_table(
Function statistics_summary_dataframe
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def statistics_summary_dataframe(
Function edit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def edit(request, conversation_id, slug, board_slug, **kwargs):
conversation = Conversation.objects.get(id=conversation_id)
board = Board.objects.get(slug=board_slug)
form = forms.ConversationForm(request=request, instance=conversation)
can_publish = request.user.has_perm("ej_conversations.can_publish_promoted")
- 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 conversation_comment_form
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def conversation_comment_form(conversation, request=None, content=None, user=None, form=None, target=None):
Function kmeans_run
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def kmeans_run(data, k: int, max_iter=10, init_centroids=None, distance=None, aggregator=None):
Function queryset_closure
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def queryset_closure():
"""
Register function that handle rendering of querysets.
"""
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"
Further reading
Function sass
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def sass(ctx, theme=None, watch=False, background=False, suffix="default", minify=False):
Function comment_card
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def comment_card(comment: Comment, request=None, target=None, show_actions=None, message=None, **kwargs):
Function save_hook
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def save_hook(self, request, vote):
user = request.user
author = vote.comment.conversation.author
user_signature = SignatureFactory.get_user_signature(author)
create_mautic_contact_from_author(request, vote)
- 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 exec_watch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def exec_watch(path, func, name, watch=False, background=False, poll_time=0.5):
Function cluster_shapes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cluster_shapes(clusterization, clusters=None, user=None):
"""
Return a list of cluster shapes from given clusterization object.
Args:
- 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 js
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def js(ctx, watch=False, minify=False):
"""
Build js assets
"""
build_cmd = "npm run watch" if watch else "npm run build"
- 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 conversation_download_data
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def conversation_download_data(conversation, *, which, formats=None, cluster=None, **url_kwargs):