jstacoder/flask-tasks

View on GitHub

Showing 38 of 50 total issues

Function QuickAddCtrl has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

function QuickAddCtrl($scope,$modalInstance,addTaskToProject,$routeParams,$rootScope,project,$location,p){
Severity: Major
Found in flask_tasks/static/js/app/projects/list.js - About 1 hr to fix

    Function AddProjCtrl has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function AddProjCtrl(projects,deleteProject,removeProjectFromRoot,addProjectToRoot,addProject,$modal,$scope,projectPage){
    Severity: Major
    Found in flask_tasks/static/js/app/projects/add.js - About 1 hr to fix

      Function ProjCtrl has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function ProjCtrl(project,$location,$interpolate,sortByPriority,completeTask,$window,$q,$rootScope){
      Severity: Major
      Found in flask_tasks/static/js/app/projects.js - About 1 hr to fix

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

            def get(self,item_id):
                proj = Project.get_by_id(item_id)
                if proj is not None:
                    result = proj.to_json(add_tasks=True)
                    tasks = proj.tasks.all()            
        Severity: Minor
        Found in flask_tasks/projects/api/views.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 _add_test has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def _add_test(self,data_func,model,expected_response,excludes=None,content_type=None,*args,**kwargs):
        Severity: Major
        Found in tests.py - About 50 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if not updated:
                                      updated = True
                                      result = jsonify(success=True,error=None)
                      send_msg('update:task',task.save().to_json())
          Severity: Major
          Found in flask_tasks/tasks/api/views.py - About 45 mins to fix

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

                def post(self):
                    self._process_post()
                    proj = Project.query.get(self.data['item_id'])
                    success = None
                    if proj:
            Severity: Minor
            Found in flask_tasks/projects/api/views.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 get_app has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def get_app(settings=None,extensions=None,add_default_extensions=True,*args,**kwargs):
                reset_db = None
                if 'reset_db' in kwargs:
                    reset_db = kwargs.pop('reset_db')
                app = Flask(__name__,*args,**kwargs)
            Severity: Minor
            Found in flask_tasks/__init__.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 get_app has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def get_app(settings=None,extensions=None,add_default_extensions=True,*args,**kwargs):
            Severity: Minor
            Found in flask_tasks/__init__.py - About 35 mins to fix

              Function _add_test has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _add_test(self,data_func,model,expected_response,excludes=None,content_type=None,*args,**kwargs):
                      _kwargs = {}
                      if content_type is not None:
                          kwargs['content_type'] = content_type
                          _kwargs['content_type'] = content_type
              Severity: Minor
              Found in tests.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 _test_add_form has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _test_add_form(self,model,expected_response,excludes=None,**kwargs):
                      data = dict(**kwargs)
                      res = self._send_add_request(model,data=data)
                      if excludes:
                          for itm in excludes:
              Severity: Minor
              Found in tests.py - About 25 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 _test_add_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _test_add_json(self,model,expected_response,excludes=None,**kwargs):
                      data = json.dumps(dict(**kwargs))
                      res = self._send_add_request(model,data,content_type='application/json')
                      if excludes:
                          for itm in excludes:
              Severity: Minor
              Found in tests.py - About 25 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 worker_int has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              def worker_int(worker):
                  worker.log.info("worker received INT or QUIT signal")
              
                  ## get traceback info
                  import threading, sys, traceback
              Severity: Minor
              Found in gconf.py - About 25 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 MainCtrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function MainCtrl(socket,$rootScope,$scope){
                  var self = this;
                  $scope.priority_values = {
                          '1':false,
                          '2':false,
              Severity: Minor
              Found in flask_tasks/static/js/app.js - About 25 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 post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def post(self):
                      self._process_post()
                      success = None
                      try:
                          task = Task.query.get(self.data.get('item_id'))
              Severity: Minor
              Found in flask_tasks/tasks/api/views.py - About 25 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 to_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def to_json(self,in_list=True,add_urls=True):
                      opts = {}
                      if self.due_date:
                          opts['due_date'] = self.due_date.ctime()
                      if self.project_id:
              Severity: Minor
              Found in flask_tasks/tasks/models.py - About 25 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 _test_add_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _test_add_data(self,model,expected_response,excludes=None,**kwargs):
                      data = dict(**kwargs)
                      res = self._send_add_request(model,json.dumps(data))
                      if excludes:
                          for itm in excludes:
              Severity: Minor
              Found in tests.py - About 25 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 TaskCtrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              function TaskCtrl(project,task,activeTasks,$routeParams,$route,$location,$window,$interpolate,$scope){
                  var self = this,
                      projectUrlFunc = $interpolate('/app/project/{{ pid }}'),
                      changeFunc = $interpolate('/app/project/{{ pid }}/{{ tid }}');
              
              
              Severity: Minor
              Found in flask_tasks/static/js/app/projects.js - About 25 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

              Severity
              Category
              Status
              Source
              Language