Showing 44 of 179 total issues
Function generateTemplates
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateTemplates : function () {
// create async process
var done = this.async();
// par sella available modules
Function build
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
build : function (activeMock) {
// mock is active ?
if (activeMock) {
$http.get('assets/mocks/mocks.json').then(function successCallback (success) {
// check if the success.data has expectRoutes
Function process
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
process : function (key, properties, config) {
// normalize properties
properties = _.isObject(properties) ? properties : {};
// normalize config
Function generateFiles
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateFiles : function () {
// create async process
var done = this.async();
// types list
Function generateFiles
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateFiles : function () {
// create async process
var done = this.async();
// types list
Function generateDirectory
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateDirectory : function () {
// create async process
var done = this.async();
// to execute
Function base
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.base = function (req, res) {
// default config object
var config = {};
// normalize it
Function generateExtraDependencies
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateExtraDependencies : function () {
// create async process
var done = this.async();
// to execute
Function generateDirectory
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateDirectory : function () {
// create async process
var done = this.async();
// to execute
Function successCallback
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$http.get('assets/mocks/mocks.json').then(function successCallback (success) {
// check if the success.data has expectRoutes
if (_.has(success.data, 'expectRoutes')) {
// Parse the success.data.expectRoutes to build expect $httpBackend routes
_.forEach(success.data.expectRoutes, function (obj) {
Function generateExtraDependencies
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateExtraDependencies : function () {
// create async process
var done = this.async();
// to execute
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (grunt) {
// init config
grunt.initConfig({
// default package
pkg : grunt.file.readJSON('package.json'),
Function $get
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ($http, appConstants, $rootScope, $q, logService) {
// Default statement
return {
/**
* Map configure method to change data from another place withour provider scope
Function packages
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
packages : function () {
// banner message
this.banner('We will install needed packages');
// process install for each type
_.each([ 'node', 'angular'], function (type) {
Function packages
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
packages : function () {
// banner message
this.banner('We will install needed packages');
// process install for each type
_.each([ 'node', 'angular'], function (type) {
Function robots
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.robots = function(req, res) {
// default data
var data = {};
// try process
Function api
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.api = function (req, res) {
// Retrieve api information
var api = this.get('config').config.api;
// Retrieve app information
var app = this.get('config').config.app;
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init : function () {
// default banner
this.banner('We are initializing some data. Take a cofee and wait a few moment.');
// create async process
var done = this.async();
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init : function () {
// default banner
this.banner('We are initializing some data. Take a cofee and wait a few moment.');
// create async process
var done = this.async();
Function api
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.api = function (req, res) {
// Retrieve api information
var api = this.get('config').config.api;
// Retrieve app information
var app = this.get('config').config.app;
- 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"