Showing 2,031 of 3,395 total issues
Function load
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
load(bindings) {
var self = this;
var ret = new PackageRegistry();
// XXX This is mostly duplicated from
Function request
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
request: function (urlOrOptions, callback) {
var options;
if (!_.isObject(urlOrOptions)) {
options = { url: urlOrOptions };
} else {
Function priceVersions
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
CS.VersionPricer.prototype.priceVersions = function (versions, mode, options) {
var self = this;
var getMajorMinorPatch = function (v) {
var vInfo = self.getVersionInfo(v);
- 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 buildmessage.js
has 446 lines of code (exceeds 250 allowed). Consider refactoring. Open
var _ = require('underscore');
var files = require('../fs/files');
var parseStack = require('./parse-stack');
var fiberHelpers = require('./fiber-helpers.js');
var Progress = require('../console/progress').Progress;
Function makeCompileStep
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
exports.makeCompileStep = function (sourceItem, file, inputSourceArch, options) {
var resources = options.resources;
var addAsset = options.addAsset;
var relPath = sourceItem.relPath;
- 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 _emitResources
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
_emitResources(sourceBatches, onJsOutputFiles = () => {}) {
buildmessage.assertInJob();
const isWeb = archinfo.matches(this.arch, 'web');
const isOs = archinfo.matches(this.arch, 'os');
Function computeJsOutputFilesMap
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
static computeJsOutputFilesMap(sourceBatches) {
const map = new Map;
sourceBatches.forEach(batch => {
const name = batch.unibuild.pkg.name || null;
Function patch_splitMax
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_splitMax = function(patches) {
var patch_size = this.Match_MaxBits;
for (var x = 0; x < patches.length; x++) {
if (patches[x].length1 <= patch_size) {
continue;
- 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 makeCompileStep
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.makeCompileStep = function (sourceItem, file, inputSourceArch, options) {
var resources = options.resources;
var addAsset = options.addAsset;
var relPath = sourceItem.relPath;
Function loadServerBundles
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
var loadServerBundles = Profile("Load server bundles", function () {
var infos = [];
serverJson.load.forEach(function (fileInfo) {
var code = fs.readFileSync(path.resolve(serverDir, fileInfo.path));
File driver.js
has 421 lines of code (exceeds 250 allowed). Consider refactoring. Open
////
//// Setup
////
import { diff_match_patch } from './diff_match_patch_uncompressed'
import 'bootstrap/dist/css/bootstrap.min.css';
Function notNeeded
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
FastClick.notNeeded = function(layer) {
var metaViewport;
var chromeVersion;
var blackberryVersion;
var firefoxVersion;
- 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 maybeUpdateRelease
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
var maybeUpdateRelease = function (options) {
// We are only updating packages, so we are not updating the release.
if (options["packages-only"]) {
return 0;
}
- 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 accounts_client.js
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {AccountsCommon} from "./accounts_common.js";
/**
* @summary Constructor for the `Accounts` object on the client.
* @locus Client
File package-version-parser-tests.js
has 416 lines of code (exceeds 250 allowed). Consider refactoring. Open
var currentTest = null;
Tinytest.add("package-version-parser - validatePackageName", function (test) {
var badName = function (packageName, messageExpect) {
test.throws(function () {
Function minMaxWS
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
var minMaxWS = function (solver, solution, costTerms, costWeights, options,
isMin) {
var curSolution = solution;
var curCost = curSolution.getWeightedSum(costTerms, costWeights);
- 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 call
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
HTTP.call = function(method, url, options, callback) {
////////// Process arguments //////////
if (! callback && typeof options === "function") {
- 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 diff_cleanupSemanticLossless
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
/**
* Given two strings, compute a score representing whether the internal
* boundary falls on logical boundaries.
* Scores range from 6 (best) to 0 (worst).
- 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 runTest
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
static runTest(testList, test, testRunner, options = {}) {
options.retries = options.retries || 0;
let failure = null;
let startTime;
- 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 treemap
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3.layout.treemap = function() {
var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
function scale(children, k) {
var i = -1, n = children.length, child, area;
while (++i < n) {