Showing 241 of 434 total issues
Function google_auth
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def google_auth(self):
client_id = self.request.get('client_id')
redirect_uri = self.request.get('redirect_uri')
state = self.request.get('state')
id_token = self.request.get('id_token')
- 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_note
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_note(user, note_id):
STRIP_WORDS = ["Pocket:"]
title = url = content = None
access_token = user_access_token(user)
if access_token:
- 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 goal_data
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
goal_data() {
let {goals} = this.props;
let {goal_year} = this.state
let points = []
let periods = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", goal_year];
Function journal_data
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
journal_data() {
let {chart_enabled_questions, questions, journal_tag_segment} = this.state;
let {journals} = this.props;
let labels = [];
let chart_questions = questions.filter((q) => {
Function changeHandler
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
changeHandler: function(target) {
target.prototype.changeHandlerVal = function(key, attr, value) {
var state = {};
if (key != null) {
state[key] = this.state[key] || {};
Function render
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let t = this.props.task;
let {onDelete, onArchive, onEdit, onUpdateStatus, onClearTimerLogs,
checkbox_enabled, edit_enabled, wip_enabled,
archive_enabled, delete_enabled} = this.props;
Function generate_averages_dataset
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
generate_averages_dataset(snapshots, dim) {
let {form} = this.state;
let sb = form.segment_by;
if (dim == null) dim = sb;
let dimension_metric_aves = {};
Function get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def get(self):
from services.github import GithubClient
last_date = self.request.get('date')
if last_date:
last_date = tools.fromISODate(last_date)
- 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 serve
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def serve(self, d):
import cloudstorage as gcs
rid = self.request.get('rid')
r = self.user.get(Report, rid)
if r:
- 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 gets
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def gets(self, strings=[], lists=[], floats=[], integers=[], booleans=[],
Function Create
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def Create(email=None, g_id=None, name=None, password=None):
from constants import ADMIN_EMAIL, SENDER_EMAIL, SITENAME, \
APP_OWNER, DEFAULT_USER_SETTINGS
if email or g_id:
u = User(email=email.lower() if email else None, g_id=g_id, name=name)
- 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 render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {title, subhead, link, details} = this.state;
let {layout, col_order} = this.props;
let cls = "FlashCard " + layout;
let _content, _flipping;
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {readable} = this.props;
let {notes_visible, form} = this.state;
let type = this.TYPES[readable.type - 1];
let subhead = [<span key="type" className="sh">{type}</span>, <span key="read" className="sh">{readable.read ? 'Read' : 'Unread'}</span>];
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {form, open, submitted_date} = this.state;
let {questions} = this.props;
let in_window = this.in_journal_window();
let actions = [
Function render_editor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render_editor() {
let {editing, editing_index, editing_raw, array, form} = this.state;
let {data, attributes} = this.props;
let content;
if (editing) {
Function render_data
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
render_data() {
let {data, array, primaryProp, secondaryProp, attributes, icon} = this.props;
if (array) {
let _icon;
if (icon) _icon = <FontIcon className="material-icons">{icon}</FontIcon>
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {dialog_open} = this.state;
let counts = this.count_readables();
return (
<div className="section">
Function update
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def update(self, d):
'''
Create or update
'''
id = self.request.get_range('id')
- 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 render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
render() {
let t = this.props.task;
let {onDelete, onArchive, onEdit, onUpdateStatus, onClearTimerLogs,
checkbox_enabled, edit_enabled, wip_enabled,
archive_enabled, delete_enabled} = this.props;
- 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 render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
render() {
let {show_task_progressbar, user, dialog_open} = this.props;
let {tasks, form, working, project_selector_showing} = this.state;
let now = new Date();
let total_mins = 24 * 60;
- 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"