Showing 110 of 159 total issues
Function transformData
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const transformData = (err, body, callback) => {
if (err) {
callback(err);
return;
}
Function run
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.run = function () {
var allBuilds = [];
async.each(self.plugins, function (plugin, callback) {
log('Check for builds...', self.configuration.debug);
Function OptionsViewModel
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
var OptionsViewModel = function (app) {
var self = this;
self.isMenuVisible = ko.observable(false);
self.isMenuButtonVisible = ko.observable(false);
Function exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
var self = this,
tryGetTfsProxyUrlOfDocker = function () {
return 'http://' +
process.env.TFS_PROXY_PORT_4567_TCP_ADDR +
- 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 exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
var self = this,
getRequestHeaders = function () {
if (typeof process.env.SHIPPABLE_API_TOKEN !== 'undefined') {
self.configuration.token = process.env.SHIPPABLE_API_TOKEN;
- 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 result
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const result = response.organization.pipelines.edges.map(x => {
const pipeline = x.node;
const build =
x.node.builds.edges.length > 0 ?
x.node.builds.edges[0].node : {
Function makeRequest
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
makeRequest: function (opts, callback) {
if (opts.authentication && opts.authentication.trim() === 'ntlm') {
ntlm.get({
url: opts.url,
username: opts.username,
Function transformer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const transformer = (build) => {
let color = colorScheme[
build.result ?
resultFilter[build.result] :
(build.status === statusFilter.notStarted ?
Function sortBuilds
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
sortBuilds = function (newBuilds, sortOrder, errorFirst) {
if(sortOrder == "project") {
newBuilds.sort(function (a, b) {
if(a.project > b.project) return 1;
if(a.project < b.project) return -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
Function exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
var self = this,
getBuilds = function(callback) {
makeRequest(self.config.url, function(err, result) {
if (err) {
- 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 exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function() {
var configuration = {};
var graph;
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 getLatestBuildStep
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getLatestBuildStep = (build, callback) => {
const timelineURL = build.timeline;
if (!timelineURL || timelineURL === '') {
console.log('no timeline url');
callback(null, build);
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
files: [ 'Gruntfile.js', 'app/*.js', 'app/services/*.js', 'app/public/scripts/*.js', 'test/**/*.js', '!test/**/scenario_*.js' ],
options: {
Function requestBuilds
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
requestBuilds = function (callback) {
const {
vcs,
username,
project,
Function configure
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.configure = function (config) {
self.configuration = config;
if (!self.configuration.slug) {
console.error(`[Drone] Please configure the [slug] parameter`);
Function prioritySort
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
prioritySort = function (a, b)
{
if (b.hasErrors)
{
return 1;
Function configure
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
self.configure = function(config) {
self.configuration = config;
if (!self.configuration.vcs) {
console.error(`[CircleCI] Please configure the [vcs] parameter`);
Function updateCurrentBuildsWithChanges
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateCurrentBuildsWithChanges = function (changes) {
if (anyBuildMatchesToNotifcationFilter(changes.removed) ||
anyBuildMatchesToNotifcationFilter(changes.added) ||
anyBuildMatchesToNotifcationFilter(changes.updated)) {
self.setHasUnreadBuilds(true);
Function detectChanges
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
detectChanges = function (currentBuilds, newBuilds) {
var changes = {
added: [],
removed: [],
updated: []
Function loadProjects
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadProjects = function(callback) {
var slugs = self.config.slugs,
matchers = slugs.map(slug => slug.project),
findNamespaceIndexInMatchers = function(namespace) {
for(var i = 0; i < matchers.length; i++){