Showing 241 of 434 total issues
Function initAppCache
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
initAppCache: function() {
appCache = window.applicationCache;
appCache.addEventListener('updateready', function(e) {
if (appCache.status == appCache.UPDATEREADY) {
// Browser downloaded a new app cache.
Function constructor
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
snapshots: [],
dimensions: {},
Function __init__
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(self, rkey, start_att="__key__", start_att_desc=False, title="Report"):
self.report = rkey.get()
if not self.report:
logging.error("Error retrieving report [ %s ] from db" % rkey)
return
Function fetch_annual_journals
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetch_annual_journals() {
let {form} = this.state
let open_ended_numeric = this.numeric_questions().filter((q) => q.response_type == 'number_oe')
if (!form.annual_viewer_key) {
let qs = this.numeric_questions()
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {annual, monthly, set_goal_form, set_goal_label} = this.state;
let goal_label;
if (set_goal_label) goal_label = set_goal_label;
let _goals = (
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {loaded, goals,
habits, habitdays, iso_dates,
tracking_days,
journals, tasks, end} = this.state;
Function get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get(self):
from services.gfit import FitClient
users = User.SyncActive('gfit')
res = {}
date = (datetime.today() - timedelta(days=1)).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 render_secondary
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render_secondary() {
let {absolute_date} = this.props;
let t = this.props.task;
let hours_until = util.hours_until(t.ts_due);
let _icon
- 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 printDateObj
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
printDateObj: function(date, _timezone, opts) {
if (_timezone && moment) {
// Using moment.js to print local date/times
let dt = moment.tz(date.getTime(), _timezone);
let format = "YYYY-MM-DD";
- 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_goal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render_goal(g, type) {
let {assessment_form, assessment_showing} = this.state;
let goal_list, create_prompt, assess_prompt
let date_printed = "";
let date = 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 render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
let t = this.props.task;
let inner;
if (!t) inner = <span></span>
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_user_credentials_object
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_user_credentials_object(self):
if not self.credentials:
cr_json = self.get_google_credentials()
if cr_json:
# Note JSON is stored as escaped string, not 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 CreateFromText
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def CreateFromText(user, text):
new_jts = []
all_jts = []
if text and isinstance(text, basestring):
people = re.findall(r'@([a-zA-Z]{3,30})', text)
- 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 getJson
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def getJson(raw, default=None):
'''
Returns either a list or dictionary, or None
'''
j = None
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {form} = this.state;
let {user} = this.props
return (
<div>
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {journal, questions} = this.props;
let data = journal.data;
let responses = questions.map((q, i) => {
let q_response = data[q.name];
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let {form} = this.state;
let taskData = this.task_data()
let taskOptions = {
scales: {
Function render_set_goal_form
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render_set_goal_form() {
let {set_goal_form, form} = this.state;
let goal_slots = Math.min(this.props.goal_slots, AppConstants.GOAL_MAX_SLOTS)
if (set_goal_form) {
let _inputs = form.text.map((t, i) => {
Function generate_habit_table
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
generate_habit_table() {
let {habits} = this.state;
let habit_rows = [];
let target = 0, done = 0, committed = 0, committed_done = 0;
habits.sort(this.name_sort.bind(this)).forEach((h) => {
Function timesince
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
timesince(ms) {
let LEVELS = [
{ label: "second", cutoff: 60, recent: true, seconds: 1 },
{ label: "minute", cutoff: 60, seconds: 60 },
{ label: "hour", cutoff: 24, seconds: 60*60 },