onejgordon/flow-dashboard

View on GitHub

Showing 241 of 434 total issues

File TaskWidget.js has 354 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var React = require('react');
import { IconButton, List,
  IconMenu, FontIcon, MenuItem, TextField, AutoComplete,
  FlatButton, Dialog, Checkbox } from 'material-ui';
import PropTypes from 'prop-types';
Severity: Minor
Found in src/js/components/TaskWidget.js - About 4 hrs to fix

    Function render has 111 lines of code (exceeds 25 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;
    Severity: Major
    Found in src/js/components/TaskWidget.js - About 4 hrs to fix

      Function render has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          render() {
              let {form} = this.state;
              let {user} = this.props;
              if (!user) return <div></div>;
              let gr_user_id, gh_user, gh_pat, en_notebook_ids, evernote_connected, en_evernote_max_quote_length;
      Severity: Major
      Found in src/js/components/Integrations.js - About 4 hrs to fix

        Function _habit_or_task_report has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            def _habit_or_task_report(self, item_name):
                '''
                Mark a habit or a task as complete
                '''
                handled = False
        Severity: Minor
        Found in services/agent.py - About 4 hrs to fix

        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 AnalysisSnapshot.js has 335 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var React = require('react');
        import {Link} from 'react-router';
        import {Line, Bar, Doughnut} from "react-chartjs-2";
        import connectToStores from 'alt-utils/lib/connectToStores';
        var api = require('utils/api');
        Severity: Minor
        Found in src/js/components/analysis/AnalysisSnapshot.js - About 4 hrs to fix

          Function render has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render() {
                  let {journal_tag_segment, journal_segments, map_showing } = this.state
                  let {loaded} = this.props;
                  if (!loaded) return null;
                  let _journals_segmented
          Severity: Major
          Found in src/js/components/analysis/AnalysisJournals.js - About 4 hrs to fix

            Function render_habit has 100 lines of code (exceeds 25 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()
            Severity: Major
            Found in src/js/components/HabitWidget.js - About 4 hrs to fix

              Function google_token has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                  def google_token(self):
                      '''Support oauth2 assertion
                      https://developers.google.com/actions/identity/oauth2-assertion-flow
                      '''
                      grant_type = self.request.get('grant_type')
              Severity: Minor
              Found in api.py - About 3 hrs to fix

              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 Integrations.js has 322 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              var React = require('react');
              
              var util = require('utils/util');
              var UserStore = require('stores/UserStore');
              var UserActions = require('actions/UserActions');
              Severity: Minor
              Found in src/js/components/Integrations.js - About 3 hrs to fix

                File MiniJournalWidget.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                var React = require('react');
                import PropTypes from 'prop-types';
                import {Link} from 'react-router';
                var AppConstants = require('constants/AppConstants');
                var MobileDialog = require('components/common/MobileDialog');
                Severity: Minor
                Found in src/js/components/MiniJournalWidget.js - About 3 hrs to fix

                  File Settings.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  var React = require('react');
                  import {Link} from 'react-router';
                  var AppConstants = require('constants/AppConstants');
                  var util = require('utils/util');
                  var api = require('utils/api');
                  Severity: Minor
                  Found in src/js/components/Settings.js - About 3 hrs to fix

                    HabitWidget has 30 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    @changeHandler
                    export default class HabitWidget extends React.Component {
                    
                      static propTypes = {
                        days: PropTypes.number,
                    Severity: Minor
                    Found in src/js/components/HabitWidget.js - About 3 hrs to fix

                      File reports.py has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import traceback
                      import tools
                      from google.appengine.ext import ndb
                      from google.appengine.api import logservice, memcache
                      from models import Project, HabitDay, Task, Goal, MiniJournal, Event, TrackingDay
                      Severity: Minor
                      Found in reports.py - About 3 hrs to fix

                        Function respond_to_action has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def respond_to_action(self, action, parameters=None, session=None):
                                speech = None
                                end_convo = True
                                if not parameters:
                                    parameters = {}
                        Severity: Minor
                        Found in services/agent.py - About 3 hrs to fix

                        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 auto_cache has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def auto_cache(expiration=60*60, key=None):
                            """
                            A decorator to memorize the results of a function call in memcache. Use this
                            in preference to doing your own memcaching, as this function avoids version
                            collisions etc...
                        Severity: Minor
                        Found in common/decorators.py - About 3 hrs to fix

                        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

                        TaskWidget has 29 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        @connectToStores
                        @changeHandler
                        class TaskWidget extends React.Component {
                          static propTypes = {
                            user: PropTypes.object,
                        Severity: Minor
                        Found in src/js/components/TaskWidget.js - About 3 hrs to fix

                          Function render has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              render() {
                                  let {form, reading_detail} = this.state;
                                  let readable_params = {};
                                  if (form.reading_filter) readable_params[form.reading_filter] = 1;
                                  return (
                          Severity: Major
                          Found in src/js/components/Reading.js - About 3 hrs to fix

                            Function render_content has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              render_content() {
                                let {project} = this.props;
                                let points = [this._point(0, project.ts_created)];
                                let today = new Date();
                                let projected_completion;
                            Severity: Major
                            Found in src/js/components/ProjectAnalysis.js - About 3 hrs to fix

                              Function render_annual_viewer has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  render_annual_viewer() {
                                      let {form, annual_viewer_journals, data_ranges} = this.state
                                      let options = this.numeric_questions().map((q) => {
                                          return {value: q.name, label: q.text}
                                      })
                              Severity: Minor
                              Found in src/js/components/analysis/AnalysisJournals.js - About 3 hrs to fix

                              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 action has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def action(self, d):
                                      '''
                                      '''
                                      action = self.request.get('action')
                                      res = {}
                              Severity: Minor
                              Found in api.py - About 3 hrs to fix

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language