onejgordon/flow-dashboard

View on GitHub

Showing 241 of 434 total issues

Function parse_message has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_message(self, message):
        action = None
        parameters = None
        self.cs = self._get_conversation_state()
        in_convo = self.cs is not None
Severity: Minor
Found in services/agent.py - About 1 hr 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 send_response has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def send_response(self):
        if self.fb_id and (self.reply or self.message_data):
            message_object = {}
            if self.reply and 'attachment' not in self.message_data:
                message_object['text'] = self.reply
Severity: Minor
Found in services/agent.py - About 1 hr 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 safe_add_task has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

def safe_add_task(callable, *args, **kwargs):
    """This function guarantees addition of a task to a queue.
        It retries safe_add_tasks adding task if any error occurs during task creation.

    There are 3 ways to use this function
Severity: Minor
Found in tools.py - About 1 hr 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 trend_data has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    trend_data(day_counts) {
        let {iso_dates, habits} = this.state;
        let rwindow = [];
        let series_data = [];
        let labels = [];
Severity: Minor
Found in src/js/components/analysis/AnalysisHabits.js - About 1 hr to fix

    Function handle_tag_selected has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        handle_tag_selected(chosenRequest, index) {
            let {tags, journal_segments, questions} = this.state;
            let {journals} = this.props;
            let tag = tags[index];
            let aggregate = {};
    Severity: Minor
    Found in src/js/components/analysis/AnalysisJournals.js - About 1 hr to fix

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

        render() {
          let {all_showing} = this.state;
          let {initially_show} = this.props;
          let n_projects = this.count_projects();
          let empty = n_projects == 0;
      Severity: Minor
      Found in src/js/components/ProjectViewer.js - About 1 hr to fix

        Function render_tag_suggest has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render_tag_suggest(str, qname) {
            let {tags_loading} = this.state;
            let entering_tag = false;
            let _content, _selector;
            let last_space = str.lastIndexOf(' ');
        Severity: Minor
        Found in src/js/components/JournalEditor.js - About 1 hr to fix

          Function render_admin_section has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render_admin_section() {
                  let {form} = this.state;
                  let {user} = this.props;
                  let bigquery_dataset_name = null, bigquery_table_name = null;
                  if (user && user.integrations) {
          Severity: Minor
          Found in src/js/components/Integrations.js - About 1 hr to fix

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

                render() {
                    let {form} = this.state;
                    let params = clone(form);
                    if (form.date_from) params.date_from = util.printDateObj(form.date_from);
                    if (form.date_to) params.date_to = util.printDateObj(form.date_to);
            Severity: Minor
            Found in src/js/components/TrackingHistory.js - About 1 hr to fix

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

                  render() {
                      let {goals} = this.props;
                      let {goal_detail, form, goal_year} = this.state;
                      let today = new Date();
                      let goalData = this.goal_data();
              Severity: Minor
              Found in src/js/components/analysis/AnalysisGoals.js - About 1 hr to fix

                Function render has a Cognitive Complexity of 12 (exceeds 5 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;
                Severity: Minor
                Found in src/js/components/FlashCard.js - About 1 hr 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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  render() {
                    let {form} = this.state;
                    let {fts_url} = this.props;
                    let _search_box;
                    var _items = this.state.items.map(function(item, i, arr) {
                Severity: Minor
                Found in src/js/components/common/FetchedList.js - About 1 hr 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 render_tag_suggest has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  render_tag_suggest(str, qname) {
                    let {tags_loading} = this.state;
                    let entering_tag = false;
                    let _content, _selector;
                    let last_space = str.lastIndexOf(' ');
                Severity: Minor
                Found in src/js/components/JournalEditor.js - About 1 hr 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 render has a Cognitive Complexity of 12 (exceeds 5 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];
                Severity: Minor
                Found in src/js/components/list_items/JournalLI.js - About 1 hr 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 Create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    def Create(user, title, due=None, tomorrow=None):
                        if not due:
                            tz = user.get_timezone()
                            local_now = tools.local_time(tz)
                            task_prefs = user.get_setting_prop(['tasks', 'preferences'], {})
                Severity: Minor
                Found in models.py - About 1 hr 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 lookupDict has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                def lookupDict(item_list, keyprop="key_string", valueTransform=None):
                    """
                    keyprop can be 'key_string', 'key_id', or a property name
                    if valueProp is None, value at each key is full item from list
                    otherwise, run specified function to get value to store in dict
                Severity: Minor
                Found in tools.py - About 1 hr 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 render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    let {user} = this.props;
                    let {SITENAME} = AppConstants;
                    let LOGO = <img src="/images/logo_white.png" className="flowlogo glow" width="50" />
                    let right_icon;
                Severity: Minor
                Found in src/js/components/App.js - About 1 hr to fix

                  Function get_data has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      get_data() {
                          let {form, dimensions, snapshots} = this.state;
                          let {segment_by} = form;
                          let segment_var = dimensions[segment_by];
                          if (segment_var) {
                  Severity: Minor
                  Found in src/js/components/analysis/AnalysisSnapshot.js - About 1 hr to fix

                    Function render_dialog has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render_dialog() {
                        let {project_dialog_open, updating, form} = this.state;
                        let editing = form.id != null;
                        let actions = [
                          <RaisedButton primary={true} label={editing ? "Update" : "Create"} onClick={this.update_project.bind(this)} disabled={updating} />,
                    Severity: Minor
                    Found in src/js/components/ProjectViewer.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (open) {
                            title = readable.title;
                            if (readable.author) title += ` (${readable.author})`;
                            actions = [
                              <RaisedButton primary={true} label="Save" onClick={this.save.bind(this)} disabled={!editing} />,
                      Severity: Critical
                      Found in src/js/components/ReadingDetail.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language