iorrah/you-rockstar

View on GitHub
app/components/resume/yr-control.js

Summary

Maintainability
C
1 day
Test Coverage

Showing 6 of 6 total issues

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

getPrev: function(type) {
var items = this.get(type.pluralize());
var size = items.length;
var i = size - 1;
var id = this.get(type + '.id');
Severity: Minor
Found in app/components/resume/yr-control.js - About 35 mins to fix

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

getNext: function(type) {
var items = this.get(type.pluralize());
var size = items.length;
var i = 0;
var id = this.get(type + '.id');
Severity: Minor
Found in app/components/resume/yr-control.js - About 35 mins to fix

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

goToNext: function() {
if (this.get('state.template')) {
this.repo().template().setNext();
} else if (this.get('state.theming')) {
this.repo().theming().setNext();
Severity: Major
Found in app/components/resume/yr-control.js and 1 other location - About 2 hrs to fix
app/components/resume/yr-control.js on lines 116..122

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

goToPrev: function() {
if (this.get('state.template')) {
this.repo().template().setPrev();
} else if (this.get('state.theming')) {
this.repo().theming().setPrev();
Severity: Major
Found in app/components/resume/yr-control.js and 1 other location - About 2 hrs to fix
app/components/resume/yr-control.js on lines 109..115

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

theming: function() {
return {
setNext: function() {
self.send('selectPalette', self.getNext('palette'));
},
Severity: Major
Found in app/components/resume/yr-control.js and 1 other location - About 1 hr to fix
app/components/resume/yr-control.js on lines 127..136

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

template: function() {
return {
setNext: function() {
self.send('selectTemplate', self.getNext('template'));
},
Severity: Major
Found in app/components/resume/yr-control.js and 1 other location - About 1 hr to fix
app/components/resume/yr-control.js on lines 137..146
Category
Status