onejgordon/flow-dashboard

View on GitHub

Showing 241 of 434 total issues

Avoid deeply nested control flow statements.
Open

                            if _user_id and _pass:
                                if _user_id.isdigit():
                                    # Interpret as User ID
                                    user = User.get_by_id(int(_user_id))
                                elif '@' in _user_id:
Severity: Major
Found in authorized.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if author_keys:
                            author = authors.get(author_keys[0], {}).get('name')
                    archived = int(status) == 1
    Severity: Major
    Found in services/pocket.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if name is not None:
                              author = name.text
                      r = Readable.CreateOrUpdate(user, isbn, title=title,
      Severity: Major
      Found in services/goodreads.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                for tn in task_names:
                                    task = Task.Create(self.user, tn)
                                    tasks.append(task)
                            ndb.put_multi(tasks)
        Severity: Major
        Found in services/agent.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if not account_exists:
                                      self.set_response({'error': 'user_not_found'}, status=401)
                                  else:
                                      self._google_return_tokens(u)
                                      ok = True
          Severity: Major
          Found in api.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if is_article:
                                        # Treat as article
                                        r = Readable.CreateOrUpdate(user, uid, source='evernote', url=url, title=title)
                                        r.put()
                                        self.success = True
            Severity: Major
            Found in api.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if self.valid_atom_value(raf, val):
                                          fields.append(search.AtomField(name=raf, value=val))
                      sd = search.Document(doc_id=self.get_doc_id(), fields=fields, language='en')
              Severity: Major
              Found in models.py - About 45 mins to fix

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

                    def update(self, d):
                        id = self.request.get('id')
                        params = tools.gets(self,
                            strings=['source', 'content', 'link', 'location', 'date'],
                            lists=['tags']
                Severity: Minor
                Found in api.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 _process_request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _process_request(self):
                        '''
                        Populate self.reply and self.data
                        '''
                        if self.request_type == FacebookAgent.REQ_MESSAGE:
                Severity: Minor
                Found in services/agent.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 r:
                                            self.readable = r.key
                                            return r
                
                
                Severity: Major
                Found in models.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if first_image:
                                          image_url = first_image.get('src')
                                  if authors:
                  Severity: Major
                  Found in services/pocket.py - About 45 mins to fix

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

                        def Update(self, **params):
                            if 'name' in params:
                                self.name = params.get('name')
                            if 'timezone' in params:
                                self.timezone = params.get('timezone')
                    Severity: Minor
                    Found in models.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

                    Consider simplifying this complex logical expression.
                    Open

                            if (editing_index != null) return (
                                <div>
                                    <TextField floatingLabelText="Title" name="title" value={form.title||''} onChange={this.changeHandler.bind(this, 'form', 'title')} fullWidth />
                                    <TextField floatingLabelText="Details" name="details" value={form.details||''} onChange={this.changeHandler.bind(this, 'form', 'details')} fullWidth />
                                    <div className="row">
                    Severity: Major
                    Found in src/js/components/Timeline.js - About 40 mins to fix

                      Function changeHandlerDropDown has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          target.prototype.changeHandlerDropDown = function(key, attr, event, index, value) {
                      Severity: Minor
                      Found in src/js/utils/component-utils.js - About 35 mins to fix

                        Function onerror has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                window.onerror = function(msg, url, line, col, error) {
                        Severity: Minor
                        Found in src/js/utils/util.js - About 35 mins to fix

                          Function get has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              get: function(url, data, success, fail, opts) {
                          Severity: Minor
                          Found in src/js/utils/api.js - About 35 mins to fix

                            Function set_response has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def set_response(self, data=None, debug=False, success=None, status=None,
                            Severity: Minor
                            Found in handlers.py - About 35 mins to fix

                              Function post has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  post: function(url, data, success, fail, opts) {
                              Severity: Minor
                              Found in src/js/utils/api.js - About 35 mins to fix

                                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self, user, api='fitness', version='v3',
                                Severity: Minor
                                Found in services/gservice.py - About 35 mins to fix

                                  Function Recent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def Recent(user, limit=10, offset=0, with_archived=False, project_id=None, prefetch=None):
                                  Severity: Minor
                                  Found in models.py - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language