Showing 2,031 of 3,395 total issues
Function patch_apply
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
diff_match_patch.prototype.patch_apply = function(patches, text) {
if (patches.length == 0) {
return [text, []];
}
- 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 testSubtree
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
const testSubtree = (value, pattern, collectErrors = false, errors = [], path = '') => {
// Match anything!
if (pattern === Match.Any) {
return false;
}
File showdown.js
has 513 lines of code (exceeds 250 allowed). Consider refactoring. Open
//
// showdown.js -- A javascript port of Markdown.
//
// Copyright (c) 2007 John Fraser.
//
Function _populateWarehouseForRelease
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
_populateWarehouseForRelease: function (releaseVersion, showInstalling) {
var releasesDir = files.pathJoin(warehouse.getWarehouseDir(), 'releases');
files.mkdir_p(releasesDir, 0o755);
var releaseManifestPath = files.pathJoin(releasesDir,
releaseVersion + '.release.json');
- 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 force
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
d3.layout.force = function() {
var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, gravity = .1, theta = .8, nodes = [], links = [], distances, strengths, charges;
function repulse(node) {
return function(quad, x1, _, x2) {
if (quad.point !== node) {
Function callLoginMethod
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
callLoginMethod(options) {
options = {
methodName: 'login',
methodArguments: [{}],
_suppressLoggingIn: false,
- 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 selftest.js
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { inspect } from 'util';
import * as files from '../fs/files';
import { createHash } from 'crypto';
import {
markBottom as parseStackMarkBottom,
AccountsServer
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
export class AccountsServer extends AccountsCommon {
// Note that this constructor is less likely to be instantiated multiple
// times than the `AccountsClient` constructor, because a single server
// can provide only one set of methods.
constructor(server, options) {
Function request
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
request: function (urlOrOptions, callback) {
var options;
if (!_.isObject(urlOrOptions)) {
options = { url: urlOrOptions };
} else {
- 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 login_buttons_dropdown.js
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {passwordlessSignupFields, passwordSignupFields} from './accounts_ui.js';
import {
displayName,
getLoginServices,
hasPasswordService,
Function buildCommand
has 191 lines of code (exceeds 25 allowed). Consider refactoring. Open
var buildCommand = function (options) {
Console.setVerbose(!!options.verbose);
if (options.headless) {
// There's no point in spinning the spinner when we're running
// automated builds.
Function _inferHelper
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
BCp._inferHelper = function (inputFile, cacheEntry) {
if (! cacheEntry.controlFileData) {
return false;
}
- 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_cleanupMerge
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
// Add a dummy entry at the end.
diffs.push(new diff_match_patch.Diff(DIFF_EQUAL, ''));
var pointer = 0;
var count_delete = 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
Console
has 52 functions (exceeds 20 allowed). Consider refactoring. Open
class Console extends ConsoleBase {
constructor(options) {
super();
options = options || Object.create(null);
File utils.js
has 472 lines of code (exceeds 250 allowed). Consider refactoring. Open
var _ = require('underscore');
var semver = require('semver');
var os = require('os');
var url = require('url');
File minimongo_tests_server.js
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
Tinytest.add('minimongo - modifier affects selector', test => {
function testSelectorPaths(sel, paths, desc) {
const matcher = new Minimongo.Matcher(sel);
test.equal(matcher._getPaths(), paths, desc);
}
Function bundleAndDeploy
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function bundleAndDeploy(options) {
if (options.recordPackageUsage === undefined) {
options.recordPackageUsage = true;
}
Function startNewWatcher
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
function startNewWatcher(absPath: string): Entry {
let stat: Stats | BigIntStats | null | undefined = null;
if (DEDUPLICATE_BY_INO) {
stat = statOrNull(absPath);
- 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 doTestCommand
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doTestCommand(options) {
// This "metadata" is accessed in a few places. Using a global
// variable here was more expedient than navigating the many layers
// of abstraction across the build process.
//
Connection
has 49 functions (exceeds 20 allowed). Consider refactoring. Open
export class Connection {
constructor(url, options) {
const self = this;
this.options = options = {