jstacoder/flask-tasks

View on GitHub

Showing 38 of 50 total issues

Function ProjListCtrl has 247 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ProjListCtrl(project,$rootScope,$scope,updateTask,$q,$timeout,$modal,addTaskToProject,deleteTask,socket,p){
    var self = this,
        channel = p.subscribe('task_event');


Severity: Major
Found in flask_tasks/static/js/app/projects/list.js - About 1 day to fix

    File app.js has 439 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    var app = window.angular.module('app',[
            'ngRoute','ipCookie','ngResource','app.socket',
            'ui.bootstrap','app.routes','app.projects',
    Severity: Minor
    Found in flask_tasks/static/js/app.js - About 6 hrs to fix

      Function TaskCtrl has 114 lines of code (exceeds 25 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: Major
      Found in flask_tasks/static/js/app/projects.js - About 4 hrs to fix

        File list.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* global angular,getProjFromRoot */
        var app = angular.module('app.projects.list',[]);
        
        app.controller('ProjListCtrl',ProjListCtrl)
           .factory('updateTask',updateTask)
        Severity: Minor
        Found in flask_tasks/static/js/app/projects/list.js - About 3 hrs to fix

          TestTaskApiTestCase has 27 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class TestTaskApiTestCase(BaseCase):
              maxDiff = None
          
              def url_for(self,*args,**kwargs):
                  rtn = ''
          Severity: Minor
          Found in tests.py - About 3 hrs to fix

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

                def post(self):
                    default_result = jsonify(success=False,error='there was an error')
                    updated = False
                    result = None
                    self._process_post()
            Severity: Minor
            Found in flask_tasks/tasks/api/views.py - About 3 hrs 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 mainTest has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                mainTest = function(){ /*var document = require('jsdom').jsdom('<html><head></head><body></body></html>'), window = document.defaultView; require('angular'); require('./socket.io.js'); window.io = require('socket.io-client');*/
                require('./flask_tasks/static/js/app.js'); 
                require('./flask_tasks/static/js/app/projects.js'); 
                require('./flask_tasks/static/js/app/tasks.js');
                require('./flask_tasks/static/js/app/routes.js');
            Severity: Major
            Found in jstests.js - About 2 hrs to fix

              Function routeConfigFn has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function routeConfigFn($routeProvider,$locationProvider){
                  $routeProvider.when('/app',{
                      templateUrl:'/static/partials/home.html',
                      resolve:{
                          projects:['projectManager',function(projectManager){
              Severity: Major
              Found in flask_tasks/static/js/app/routes.js - About 2 hrs to fix

                Function bsCheckBox has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function bsCheckBox(){
                    return {
                        restrict:"A",
                        require:"?^ngModel",
                        link:bsCheckBoxLinkFn,
                Severity: Major
                Found in flask_tasks/static/js/app.js - About 2 hrs to fix

                  Function ProjListCtrl has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function ProjListCtrl(project,$rootScope,$scope,updateTask,$q,$timeout,$modal,addTaskToProject,deleteTask,socket,p){
                      var self = this,
                          channel = p.subscribe('task_event');
                  
                  
                  
                  Severity: Minor
                  Found in flask_tasks/static/js/app/projects/list.js - About 2 hrs 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

                  File projects.js has 266 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  'use strict';
                  
                  var app = angular.module('app.projects',[]);
                  
                  app.factory('projectFactory',projectFactory)
                  Severity: Minor
                  Found in flask_tasks/static/js/app/projects.js - About 2 hrs to fix

                    Function AddProjCtrl has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function AddProjCtrl(projects,deleteProject,removeProjectFromRoot,addProjectToRoot,addProject,$modal,$scope,projectPage){
                        var self = this;
                        self.projects = projects;
                        self.project = {};
                    
                    
                    Severity: Major
                    Found in flask_tasks/static/js/app/projects/add.js - About 2 hrs to fix

                      Function bsCheckBoxLinkFn has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function bsCheckBoxLinkFn(scope,ele,attrs,ctrl){
                                  console.log(arguments);
                                  var cls = ele.attr('class'),
                                      newEl = angular.element(document.createElement('span'))
                                                 .addClass('fa')
                      Severity: Major
                      Found in flask_tasks/static/js/app.js - About 2 hrs to fix

                        Function ProjCtrl has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function ProjCtrl(project,$location,$interpolate,sortByPriority,completeTask,$window,$q,$rootScope){
                            var self = this,
                                urlFunc = $interpolate('/app/project/{{ pid }}/{{ tid }}');
                        
                            self.project = project;
                        Severity: Major
                        Found in flask_tasks/static/js/app/projects.js - About 2 hrs to fix

                          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

                                  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
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language