Showing 6 of 6 total issues
Function bind
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var bind = function (resourceName, $scope, subset, callback) {
var prefix = resourceName.split('/');
if (prefix.length > 1) {
resourceName = prefix.splice(prefix.length - 1, 1);
- Create a ticketCreate a ticket
Function exports
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (config) {
'use strict';
var environment = process.env.NODE_ENV || 'dev',
customLaunchersByEnvironment = {
test: {
- Create a ticketCreate a ticket
Function exports
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
// Metadata.
- Create a ticketCreate a ticket
Function onMessage
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function onMessage(message) {
var elements = $scope[resourceName + "s"],
actions = {
created: function () {
$scope[resourceName + "s"].push(message.data);
- Create a ticketCreate a ticket
Function value
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
value: function(predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
- Read upRead up
- Create a ticketCreate a ticket
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 init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init() {
$scope.$watchCollection(resourceName + "s", function (newValues, oldValues) {
var addedElements, removedElements;
newValues = newValues || [];
oldValues = oldValues || [];
- Create a ticketCreate a ticket