Showing 22 of 106 total issues
File my_mastodon.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8
import arrow
# django classes
from django.conf import settings
File services.py
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding: utf-8
# django stuff
from django.conf import settings
from django.core.cache import caches
from django.urls import reverse
Function read_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_data(self, **kwargs):
"""
get the data from the service
as the pushbullet service does not have any date
in its API linked to the note,
- 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_published
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_published(self, entry):
"""
get the 'published' attribute
:param entry:
:return:
- 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 _set_full_content
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _set_full_content(self, site_title, title, published,
Function trigger_edit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def trigger_edit(request, trigger_id, edit_what):
"""
edit the provider
:param request: request object
:param trigger_id: ID of the trigger to edit
- 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_queryset
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_queryset(self):
filtered_by = None
# by default, sort by date_created
ordered_by = (str('-date_triggered'), )
# get the Trigger of the connected user
- 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
Avoid deeply nested control flow statements. Open
if date_triggered is not None and \
published is not None and \
now >= published >= date_triggered:
my_toots.append({'title': title,
'content': s['content'],
Avoid deeply nested control flow statements. Open
if twitter_obj.fav:
url = twitter_fav_url.format(screen_name, s['id_str'])
title = _('Tweet Fav from @{}'.format(screen_name))
else:
url = twitter_status_url.format(screen_name, s['id_str'])
Avoid deeply nested control flow statements. Open
if newest is None:
newest = True
max_id = s['id'] - 1
screen_name = s['user']['screen_name']
Function _get_content
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_content(data, which_content):
"""
get the content that could be hidden
in the middle of "content" or "summary detail"
from the data of the provider
- 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 read_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def read_data(self, **kwargs):
"""
get the data from the service
:param kwargs: contain keyword args : trigger_id at least
:type 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
Avoid deeply nested control flow statements. Open
if date_triggered is not None and published is not None and now >= published >= date_triggered:
if s.get('extended_entities'):
# get a media
extended_entities = s['extended_entities']
if extended_entities.get('media'):
Avoid deeply nested control flow statements. Open
if condition2:
continue
if condition1 and condition2 is False:
Function _create_entry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _create_entry(self, title, data, tags):
"""
create an entry
:param title: string
:param data: 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
Avoid deeply nested control flow statements. Open
if newest is None:
newest = True
max_id = s['id'] - 1
toot_name = s['account']['username']
Function _create_content
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_content(self, site_title, content, pelican_path, url, **data):
Function read_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def read_data(self, **kwargs):
"""
get the data from the service
as the pocket service does not have any date
in its API linked to the note,
- 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 save_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save_data(self, trigger_id, **data):
"""
let's save the data
:param trigger_id: trigger ID from which to save data
:param data: the data to check to be used and save
- 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_tag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_tag(note_store, my_tags):
"""
get the tags from his Evernote account
:param note_store Evernote Instance
:param my_tags string
- 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"