jstacoder/flask-tasks

View on GitHub

Showing 50 of 50 total issues

Function QuickAddCtrl has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function QuickAddCtrl($scope,$modalInstance,addTaskToProject,$routeParams,$rootScope,project,$location,p){
    var self = this,
        channel = p.subscribe('task_event');

    self.project = project;
Severity: Major
Found in flask_tasks/static/js/app/projects/list.js - About 2 hrs to fix

    Function MainCtrl has 40 lines of code (exceeds 25 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 1 hr to fix

      Function ProjListCtrl has 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function ProjListCtrl(project,$rootScope,$scope,updateTask,$q,$timeout,$modal,addTaskToProject,deleteTask,socket,p){
      Severity: Major
      Found in flask_tasks/static/js/app/projects/list.js - About 1 hr to fix

        Function save has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function save(){
                if(!self.changedItems){
                    return;   
                }
                var promises = [],
        Severity: Minor
        Found in flask_tasks/static/js/app/projects/list.js - About 1 hr to fix

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  var projects = self.projects,
                      proj = projects.filter(function(itm){ return itm.id==pid;})[0],
                      idx = projects.indexOf(proj);
          Severity: Major
          Found in flask_tasks/static/js/app/projects/add.js and 1 other location - About 1 hr to fix
          flask_tasks/static/js/app/projects/delete.js on lines 10..12

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 58.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                  var projects = $rootScope.projects,
                      proj = projects.filter(function(itm){ return itm.id==pid;})[0],
                      idx = projects.indexOf(proj);
          Severity: Major
          Found in flask_tasks/static/js/app/projects/delete.js and 1 other location - About 1 hr to fix
          flask_tasks/static/js/app/projects/add.js on lines 99..101

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 58.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Function TaskCtrl has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function TaskCtrl(project,task,activeTasks,$routeParams,$route,$location,$window,$interpolate,$scope){
          Severity: Major
          Found in flask_tasks/static/js/app/projects.js - About 1 hr to fix

            Function hoverIcon has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function hoverIcon(){
                return {
                    restrict:"E",
                    scope:{
                        icon:"@"
            Severity: Minor
            Found in flask_tasks/static/js/app.js - About 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  self.nextTask = function(){
                      var rtn = changeFunc({pid:self.project.id,tid:getNextTask(self.tid)});
                      return rtn;
                  };
              Severity: Major
              Found in flask_tasks/static/js/app/projects.js and 1 other location - About 1 hr to fix
              flask_tasks/static/js/app/projects.js on lines 64..67

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 57.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  self.lastTask = function(){
                      var rtn = changeFunc({pid:self.project.id,tid:getLastTask(self.tid)});
                      return rtn;
                  };
              Severity: Major
              Found in flask_tasks/static/js/app/projects.js and 1 other location - About 1 hr to fix
              flask_tasks/static/js/app/projects.js on lines 68..71

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 57.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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 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 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

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        app.controller('AddProjCtrl',AddProjCtrl)
                           .factory('addProjectToRoot',addProjectToRoot)
                           .factory('addProject',addProject)
                           .controller('ModalInstanceCtrl',ModalInstanceCtrl)
                           .factory('projectPage',projectPage);
                        Severity: Minor
                        Found in flask_tasks/static/js/app/projects/add.js and 1 other location - About 40 mins to fix
                        flask_tasks/static/js/app/projects/list.js on lines 4..8

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 48.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                        app.controller('ProjListCtrl',ProjListCtrl)
                           .factory('updateTask',updateTask)
                           .factory('addTaskToProject',addTaskToProject)
                           .controller('QuickAddCtrl',QuickAddCtrl)
                           .factory('deleteTask',deleteTask);
                        Severity: Minor
                        Found in flask_tasks/static/js/app/projects/list.js and 1 other location - About 40 mins to fix
                        flask_tasks/static/js/app/projects/add.js on lines 3..7

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 48.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Severity
                        Category
                        Status
                        Source
                        Language