onejgordon/flow-dashboard

View on GitHub

Showing 241 of 434 total issues

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

    Function render_content has a Cognitive Complexity of 7 (exceeds 5 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: Minor
    Found in src/js/components/ProjectAnalysis.js - About 35 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 remove_item_by_key has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      remove_item_by_key(key, _keyProp) {
        var keyProp = _keyProp || "key";
        var items = this.state.items;
        for (var i=0; i<items.length; i++) {
          var _item = items[i];
    Severity: Minor
    Found in src/js/components/common/FetchedList.js - About 35 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 delete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def delete(self, d):
            id = self.request.get('id')
            r = self.user.get(Readable, id=id)
            if r:
                if r.source == 'pocket':
    Severity: Minor
    Found in api.py - About 35 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_readables has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      render_readables() {
        let {readables} = this.state;
        let res = [];
        let n_readables = Object.keys(readables).length;
        if (n_readables == 0) return <div className="empty">Nothing yet. Configure <Link to="/app/integrations">integrations</Link>.</div>
    Severity: Minor
    Found in src/js/components/ReadWidget.js - About 35 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 detail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def detail(self, id, d):
            with_days = self.request.get_range('with_days', default=0)
            habit = None
            habitdays = []
            if id:
    Severity: Minor
    Found in api.py - About 35 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 handle_exception has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def handle_exception(self, exception, debug_mode):
            exception_name = sys.exc_info()[0].__name__
            exception_details = str(sys.exc_info()[1])
            exception_traceback = ''.join(traceback.format_exception(*sys.exc_info()))
            logging.error(exception_traceback)
    Severity: Minor
    Found in handlers.py - About 35 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 7 (exceeds 5 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: Minor
    Found in src/js/components/Integrations.js - About 35 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 7 (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 35 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 changeHandler has a Cognitive Complexity of 7 (exceeds 5 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 35 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 google_login has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def google_login(self):
            from constants import ADMIN_EMAIL
            token = self.request.get('token')
            ok, _email, name = self.validate_google_id_token(token)
            u = None
    Severity: Minor
    Found in api.py - About 35 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 _user_disconnect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _user_disconnect(self, session=None):
            if self.type == AGENT_FBOOK_MESSENGER:
                self.user.fb_id = None
                self.user.put()
            elif self.type == AGENT_GOOGLE_ASST:
    Severity: Minor
    Found in services/agent.py - About 35 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 Fetch has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def Fetch(user, favorites=False, with_notes=False, unread=False, read=False,
                  limit=30, since=None, until=None, offset=0, keys_only=False):
            q = Readable.query(ancestor=user.key)
            ordering_prop = Readable.dt_added if not read else Readable.dt_read
            if with_notes:
    Severity: Minor
    Found in models.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def Update(self, **params):
            if 'source' in params:
                self.source = params.get('source')
            if 'content' in params:
                self.content = params.get('content')
    Severity: Minor
    Found in models.py - About 35 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 check_available_scopes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_available_scopes(self):
            scopes = self.credentials.retrieve_scopes(httplib2.Http())
            missing_scopes = []
            if self.scopes:
                for scope in self.scopes:
    Severity: Minor
    Found in services/gservice.py - About 35 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 batch_create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def batch_create(self, d):
            try:
                quotes = json.loads(self.request.get('quotes'))
            except Exception, e:
                quotes = []
    Severity: Minor
    Found in api.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def Update(self, **params):
            if 'name' in params:
                self.name = params.get('name').title()
            if 'description' in params:
                self.description = params.get('description').title()
    Severity: Minor
    Found in models.py - About 35 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 _tasks_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def _tasks_request(self):
            tasks = Task.Recent(self.user)
            tasks_undone = []
            n_done = Task.CountCompletedSince(self.user, datetime.combine(datetime.today(), time(0,0)))
            for task in tasks:
    Severity: Minor
    Found in services/agent.py - About 35 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 too many return statements within this function.
    Open

            return 1
    Severity: Major
    Found in scripts/fetch_gae_sdk.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return true;
      Severity: Major
      Found in src/js/utils/util.js - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language