Showing 241 of 434 total issues
File models.py
has 1434 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python
# -*- coding: utf8 -*-
from datetime import datetime, timedelta, time
from google.appengine.ext import ndb
File api.py
has 1398 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime, timedelta, time, date
from models import Project, Habit, HabitDay, Goal, MiniJournal, User, Task, \
Readable, TrackingDay, Event, JournalTag, Report, Quote, Snapshot
from constants import READABLE, GOAL
from google.appengine.ext import ndb
util
has 75 functions (exceeds 20 allowed). Consider refactoring. Open
var util = {
ListPop: function(keyval, list, _key) {
var key = _key || "id";
for (var i=0; i<list.length; i++) {
File agent.py
has 608 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/python
# -*- coding: utf-8 -*-
# API calls to interact with API.AI (Google Assistant / Actions / Home, Facebook Messenger)
Function role
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
def role(role=None):
def wrapper(handler_method):
def check_login(self, *args, **kwargs):
d = {
'SITENAME': SITENAME,
- 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 util.js
has 592 lines of code (exceeds 250 allowed). Consider refactoring. Open
var $ = require('jquery');
var moment = require('moment-timezone');
import {findIndexById} from 'utils/store-utils';
var util = {
Function render
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let _content;
let {form, settings, subtab} = this.state;
let {user} = this.props;
let weekday_start = get(settings, ['weekday_start'], AppConstants.DEFAULT_WEEK_START)
Function _journal
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def _journal(self, message=""):
DONE_MESSAGES = ["done", "that's all", "exit", "finished", "no"]
MODES = ['questions', 'tasks', 'end']
settings = tools.getJson(self.user.settings, {})
questions = settings.get('journals', {}).get('questions', [])
- 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_habit
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
render_habit(h) {
let {commitments, days} = this.props;
let {habitdays, cancellable_habitday} = this.state;
let cursor = new Date()
let today = new 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 fetch_daily_panel_data
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
def fetch_daily_panel_data(self, since=None, until=None):
self._maybe_get_habits()
self._maybe_get_journal_questions()
if not since:
since = datetime.combine((datetime.now() - timedelta(days=self.days_ago)).date(), time(0, 0))
- 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 HabitWidget.js
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
var React = require('react');
import { IconButton, IconMenu, MenuItem, Dialog,
RaisedButton, TextField, FontIcon, FlatButton,
Toggle } from 'material-ui';
var util = require('utils/util');
Function gets
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def gets(self, strings=[], lists=[], floats=[], integers=[], booleans=[],
dates=[], times=[], json=[], multi=False, addMultiBrackets=False,
getDefault=None, ignoreMissing=True, supportTextBooleans=False):
'''
Use ignoreMissing if resulting dictionary should not contain params that were not passed via request
- 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 AnalysisJournals.js
has 459 lines of code (exceeds 250 allowed). Consider refactoring. Open
var React = require('react');
var util = require('utils/util');
import {AutoComplete, FlatButton,
Checkbox, DropDownMenu, MenuItem} from 'material-ui';
var AppConstants = require('constants/AppConstants');
File tools.py
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
import os, time, random, string, logging, re, cgi
import uuid
from datetime import datetime, timedelta, date
import hashlib
import pytz
Function sync
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def sync(user, access_token):
'''
Return JSON array {title, author, isbn, image}
Sample dict from pocket:
- 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
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def get(self, d):
hack_id = self.request.get('hack_id')
res = {}
if hack_id == 'index_quotes_readables':
page = self.request.get_range('page')
- 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 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {user} = this.props;
let {snapshots, form, dimensions, loading} = this.state;
let data = this.get_data();
if (data == null) return <div></div>
Function render_content
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
render_content() {
let {habit, days} = this.props;
let {habitdays} = this.state;
let _squares = [];
let cursor = new 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 writeData
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def writeData(self):
total_i = self.counters['run']
while True:
self.query = self._get_gql_query()
if self.query:
- 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 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {habits, habitdays, editor_open, form, habit_analysis, working} = this.state;
let no_habits = habits.length == 0;
let _commit_bar, _progress_bar, table;
let target = 0, done = 0, committed = 0, committed_done = 0;