Showing 367 of 1,006 total issues
Function exports
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ($scope) {
setTimeout(function () {
if (global.location.hash === '#manual') $('a[href="#manual-setup"]').tab('show');
}, 200);
$scope.accounts = global.accounts;
Function job
has 91 lines of code (exceeds 25 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;
Function runTest
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runTest(email, password, project, branch, message, deploy) {
if (!email || !password || !project) {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
Function cmd
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
cmd: function (cmd, plugin, next) {
if (arguments.length === 2) {
next = plugin;
plugin = null;
}
Function runTest
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runTest(email, password, project, branch, message, deploy) {
if (!email || !password || !project) {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
Function html
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function html(req, res, next) {
if (req.params.org === 'auth') {
return next();
}
Function humaneDate
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
exports.humaneDate = function humaneDate(date, compareTo) {
if (!date) {
return;
}
const lang = {
- 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 humaneDate
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
exports.humaneDate = function humaneDate(date, compareTo) {
if (!date) {
return;
}
- 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 html
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function html(req, res, next) {
if (req.params.org === 'auth') {
return next();
}
const id = req.params.id;
File backchannel.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Backchannel server allows workers to stream messages back to the Node server
* in a line-buffered way. Uses SSL.
*/
File index.js
has 305 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 addJob
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
addJob(job) {
if ((job.project.name || job.project) !== this.project) return;
this.jobs[job._id] = job;
var found = -1;
- 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 auth.js
has 300 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 job
has 79 lines of code (exceeds 25 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;
Function prepareJob
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareJob(emitter, job) {
Project.findOne({ name: job.project })
.populate('creator')
.exec(function (err, project) {
if (err || !project)
File user.js
has 296 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
Function createProject
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
exports.createProject = function (req, res, next) {
if (req.params.org === 'auth') {
return next();
}
let name = `${req.params.org}/${req.params.repo}`;
- 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 createProject
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
exports.createProject = function (req, res, next) {
if (req.params.org === 'auth') {
return next();
}
- 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 authenticate
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
UserSchema.statics.authenticate = function (
email: string,
password: string,
callback: Function
): void {
Function exports
has 76 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;