onejgordon/flow-dashboard

View on GitHub

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')
Severity: Minor
Found in api.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 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:
Severity: Minor
Found in services/flow_evernote.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 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];
Severity: Minor
Found in src/js/components/analysis/AnalysisGoals.js - About 1 hr to fix

    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) => {
    Severity: Minor
    Found in src/js/components/analysis/AnalysisJournals.js - About 1 hr to fix

      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] || {};
      Severity: Minor
      Found in src/js/utils/component-utils.js - About 1 hr to fix

        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;
        Severity: Minor
        Found in src/js/components/list_items/TaskLI.js - About 1 hr to fix

          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 = {};
          Severity: Minor
          Found in src/js/components/analysis/AnalysisSnapshot.js - About 1 hr to fix

            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)
            Severity: Minor
            Found in tasks.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 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:
            Severity: Minor
            Found in api.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 gets has 14 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def gets(self, strings=[], lists=[], floats=[], integers=[], booleans=[],
            Severity: Major
            Found in tools.py - About 1 hr to fix

              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)
              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 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;
              Severity: Minor
              Found in src/js/components/FlashCard.js - About 1 hr to fix

                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>];
                Severity: Minor
                Found in src/js/components/list_items/ReadableLI.js - About 1 hr to fix

                  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 = [
                  Severity: Minor
                  Found in src/js/components/MiniJournalWidget.js - About 1 hr to fix

                    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) {
                    Severity: Minor
                    Found in src/js/components/common/ReactJsonEditor.js - About 1 hr to fix

                      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>
                      Severity: Minor
                      Found in src/js/components/common/ReactJsonEditor.js - About 1 hr to fix

                        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">
                        Severity: Minor
                        Found in src/js/components/ReadWidget.js - About 1 hr to fix

                          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')
                          Severity: Minor
                          Found in api.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 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;
                          Severity: Minor
                          Found in src/js/components/list_items/TaskLI.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 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;
                          Severity: Minor
                          Found in src/js/components/TaskWidget.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

                          Severity
                          Category
                          Status
                          Source
                          Language