Showing 50 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');
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',
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 }}');
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)
Similar blocks of code found in 2 locations. Consider refactoring. Open
def test_delete_task_not_found(self):
data = dict(item_id=5555)
res = self.client.post('/api/v1/tasks/delete',data=data).data
want = json.loads(json.dumps(DELETE_TASK_NOT_FOUND_API_RESPONSE))
self.assertEquals(json.loads(res),want)
- Read upRead up
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 69.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
def test_delete_task_success(self):
data = dict(item_id=2)
res = self.client.post('/api/v1/tasks/delete',data=data).data
want = json.loads(json.dumps(DELETE_TASK_SUCCESS_API_RESPONSE))
self.assertEquals(json.loads(res),want)
- Read upRead up
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 69.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
TestTaskApiTestCase
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class TestTaskApiTestCase(BaseCase):
maxDiff = None
def url_for(self,*args,**kwargs):
rtn = ''
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()
- Read upRead up
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');
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){
Function bsCheckBox
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bsCheckBox(){
return {
restrict:"A",
require:"?^ngModel",
link:bsCheckBoxLinkFn,
Identical blocks of code found in 2 locations. Consider refactoring. Open
angular.forEach(self.project.tasks,function(itm){
if(!itm.complete){
active.push(itm);
if(parseInt(id)==itm.id){
idx = active.length-1;
- Read upRead up
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 84.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
app.controller('MainCtrl',MainCtrl)
.directive('closingAlert',closingAlert)
.directive('hoverColor',hoverColor)
.directive('bsPanel',bsPanel)
.directive('bsAlert',bsAlert)
- Read upRead up
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 84.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
app.factory('projectFactory',projectFactory)
.factory('getProject',getProject)
.factory('getActiveProjects',getActiveProjects)
.factory('sortByPriority',sortByPriority)
.factory('completeTask',completeTask)
- Read upRead up
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 84.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
angular.forEach(self.project.tasks,function(itm){
if(!itm.complete){
active.push(itm);
if(parseInt(id)==itm.id){
idx = active.length-1;
- Read upRead up
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 84.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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');
- Read upRead up
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)
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')
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 = {};
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;