Showing 367 of 1,006 total issues
Function link
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, elm, attrs, ngModel) {
var options, opts, onChange, deferCodeMirror, codeMirror;
if (elm[0].type !== 'textarea') {
throw new Error('uiCodemirror3 can only be applied to a textarea element');
Function link
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, elm, attrs, ngModel) {
var options, opts, onChange, deferCodeMirror, codeMirror;
if (elm[0].type !== 'textarea') {
throw new Error('uiCodemirror3 can only be applied to a textarea element');
Function upgradeJob
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function upgradeJob(job, done) {
Job.findById(job._id)
.lean()
.exec(function (err, mjob) {
if (err)
Function exports
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (deps) {
const saveUser = require('./save-user')(deps);
function addUser(email, password, admin, force) {
let level = admin ? 1 : 0;
if (!email || !password) {
Function upgradeJob
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function upgradeJob(job, done) {
Job.findById(job._id)
.lean()
.exec(function (err, mjob) {
if (err) return done(err);
Function job
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
exports.job = function (req, res) {
res.statusCode = 200;
const org = req.params.org;
const repo = req.params.repo;
const jobId = req.params.job_id;
- 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 job
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
exports.job = function (req, res) {
res.statusCode = 200;
const org = req.params.org;
const repo = req.params.repo;
const jobId = req.params.job_id;
- 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 addUser
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addUser(email, password, admin, force) {
let level = admin ? 1 : 0;
if (!email || !password) {
var rl = readline.createInterface({
File auth.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
const crypto = require('crypto');
const BluebirdPromise = require('bluebird');
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const utils = require('./utils');
Function addUser
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function addUser(email, password, admin, force) {
let level = admin ? 1 : 0;
if (!email || !password) {
var rl = readline.createInterface({
input: process.stdin,
Function config
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.config = function (req, res) {
User.collaborators(req.project.name, 0, function (err, users) {
if (err) {
throw err;
}
Function projectPlugin
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function projectPlugin(req, res, next) {
let pluginid;
// if only 3 args, then get pluginid from params ":plugin"
if (arguments.length === 4) {
pluginid = req;
- 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 projectPlugin
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function projectPlugin(req, res, next) {
let pluginid;
// if only 3 args, then get pluginid from params ":plugin"
if (arguments.length === 4) {
pluginid = req;
- 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 job.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var _ = require('lodash');
var bootbox = require('bootbox');
var $ = require('jquery');
Function link
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs, paginationCtrl) {
// Setup configuration parameters
var maxSize,
boundaryLinks = paginationCtrl.getAttributeValue(attrs.boundaryLinks, config.boundaryLinks ),
Function link
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs, paginationCtrl) {
// Setup configuration parameters
var maxSize,
boundaryLinks = paginationCtrl.getAttributeValue(attrs.boundaryLinks, config.boundaryLinks ),
Function config
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.config = function (req, res) {
User.collaborators(req.project.name, 0, function (err, users) {
if (err) {
throw err;
}
Function processAndRender
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processAndRender(err, resultsDetail, results) {
if (err) throw err;
results.forEach(function (job) {
job.duration = Math.round(
File index.js
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
const _ = require('lodash');
const common = require('../common');
const config = require('../config');
const debug = require('debug')('strider:routes');
const jobs = require('../jobs');
Function validateVal
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function validateVal(val, schema) {
if (schema === String)
return `${val}`;
if (schema === Number) {
val = parseFloat(schema);
- 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"