onejgordon/flow-dashboard

View on GitHub

Showing 241 of 434 total issues

Function handle_chart_click has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    handle_chart_click(event, els) {
        let {goals} = this.props
        let {goal_year} = this.state
        let el = els[0]
        if (el != null) {
Severity: Minor
Found in src/js/components/analysis/AnalysisGoals.js - About 55 mins 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 increment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def increment(self, d):
        '''
        Increment completions for a habit with a countable daily target
        '''
        from constants import HABIT_DONE_REPLIES
Severity: Minor
Found in api.py - About 55 mins 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_gql_query has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def _get_gql_query(self):
        """Returns a query over the specified kind, with any appropriate filters applied."""
        if self.FILTERS or self.ancestor:
            query_string = "WHERE "
            if self.ancestor:
Severity: Minor
Found in reports.py - About 55 mins 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 CreateOrUpdate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def CreateOrUpdate(user, source_id, title=None, url=None,
                       type=READABLE.ARTICLE, source=None,
                       author=None, image_url=None, excerpt=None,
                       tags=None, read=False, favorite=False,
                       dt_read=None, notes=None,
Severity: Minor
Found in models.py - About 55 mins 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 generate_title has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_title(self, _title, ts_start=None, ts_end=None, **kwargs):
        title = _title
        start_text = end_text = None
        if ts_start:
            start_text = tools.sdatetime(tools.dt_from_ts(ts_start))
Severity: Minor
Found in models.py - About 55 mins 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 Recent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def Recent(user, limit=10, offset=0, with_archived=False, project_id=None, prefetch=None):
        q = Task.query(ancestor=user.key).order(-Task.dt_created)
        if not with_archived:
            q = q.filter(Task.archived == False)
        if project_id:
Severity: Minor
Found in models.py - About 55 mins 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 update_sd has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def update_sd(self, delete=False, index_put=True):
        index = self.get_index()
        sd = None
        try:
            doc_id = self.get_doc_id()
Severity: Minor
Found in models.py - About 55 mins 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 json has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def json(self, references=['project']):
        res = {
            'id': self.key.id(),
            'ts_created': tools.unixtime(self.dt_created),
            'ts_due': tools.unixtime(self.dt_due),
Severity: Minor
Found in models.py - About 55 mins 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 Update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def Update(self, **params):
        if 'title' in params:
            self.title = params.get('title')
        if 'details' in params:
            self.details = params.get('details')
Severity: Minor
Found in models.py - About 55 mins 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 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def Create(user, activity=None, place=None, people=None, metrics=None, lat=None, lon=None, date=None):
Severity: Major
Found in models.py - About 50 mins to fix

    Function timesince has a Cognitive Complexity of 8 (exceeds 5 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 },
    Severity: Minor
    Found in src/js/utils/util.js - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                            if cancelled:
                                self.report.CleanDelete()
                                logging.debug("Worker cancelled by user, report deleted.")
                                return
    
    
    Severity: Major
    Found in reports.py - About 45 mins to fix

      Function update_item_by_key has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        update_item_by_key(item, _keyProp, _delete, _add_to) {
          var add_to = _add_to || "top";
          var do_delete = _delete || false;
          var keyProp = _keyProp || "key";
          var items = this.state.items;
      Severity: Minor
      Found in src/js/components/common/FetchedList.js - About 45 mins 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 8 (exceeds 5 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>
      Severity: Minor
      Found in src/js/components/analysis/AnalysisSnapshot.js - About 45 mins 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 sorted_visible has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        sorted_visible() {
          let {initially_show, projects} = this.props;
          let {all_showing} = this.state;
          let visible = projects.sort((a,b) => {
            let a_title = a.title || ""; // Handle null
      Severity: Minor
      Found in src/js/components/ProjectViewer.js - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
      Open

        render() {
          var message = this.getMessage();
          var showNil = !this.props.loading && this.props.empty;
          var showLoadStatus = (this.props.loading || this.props.empty) && !this.props.hidden;
          var showLoader = this.props.loading;
      Severity: Minor
      Found in src/js/components/common/LoadStatus.js - About 45 mins 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 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def get(self):
              from services.flow_bigquery import BigQueryClient
              days_ago = self.request.get_range('days_ago', default=8)
              days_ago_end = self.request.get_range('days_ago_end', default=1)
              users = User.SyncActive('bigquery')
      Severity: Minor
      Found in tasks.py - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                              if u:
                                  self._google_return_tokens(u)
                                  ok = True
      
      
      Severity: Major
      Found in api.py - About 45 mins to fix

        Function deferred_task_decorator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def deferred_task_decorator(method):
            @functools.wraps(method)
            def defer_method(*args, **kwargs):
                # Collecting defered task header information
                headers = {}
        Severity: Minor
        Found in common/decorators.py - About 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def Create(user, date_start, date_end=None, title=None, details=None, color=None, **params):
        Severity: Minor
        Found in models.py - About 45 mins to fix
          Severity
          Category
          Status
          Source
          Language