Showing 2,031 of 3,395 total issues
Function addRuleToDDPRateLimiter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
addRuleToDDPRateLimiter() {
const connection = this.connection;
connection.lastRateLimitEvent = connection.lastRateLimitEvent || {};
connection.lastMethodName = connection.lastMethodName || '';
// XXX In Javascript v8 engine, we are currently guaranteed the ordering of
- 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 _waitForLengthOrTimeout
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
CallbackLogger.prototype._waitForLengthOrTimeout = function (len) {
var self = this;
if (self.fiber) {
var timeLeft = TIMEOUT;
var startTime = new Date();
- 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 _endOfLoginResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
OAuth._endOfLoginResponse = (res, details) => {
res.writeHead(200, {'Content-Type': 'text/html'});
let redirectUrl;
if (details.loginStyle === 'redirect') {
- 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 Dependency
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
CS.Dependency = function (packageConstraint, flags) {
if (typeof packageConstraint !== 'string') {
// this `if` is because Match.OneOf is really, really slow when it fails
check(packageConstraint, Match.OneOf(PV.PackageConstraint, String));
}
- 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 defaultValidateNewUserHook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function defaultValidateNewUserHook(user) {
const domain = this._options.restrictCreationByEmailDomain;
if (!domain) {
return true;
}
- 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 openCenteredPopup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const openCenteredPopup = function(url, width, height) {
const screenX = typeof window.screenX !== 'undefined'
? window.screenX : window.screenLeft;
const screenY = typeof window.screenY !== 'undefined'
? window.screenY : window.screenTop;
- 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 toJSONable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
CS.Input.prototype.toJSONable = function (omitCatalogCache) {
var self = this;
var obj = {
dependencies: self.dependencies,
constraints: self.constraints.map(function (c) {
- 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 _outstandingMethodFinished
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_outstandingMethodFinished() {
const self = this;
if (self._anyMethodsAreOutstanding()) return;
// No methods are outstanding. This should mean that the first block of
- 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 renderEndOfLoginResponse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const renderEndOfLoginResponse = options => {
// It would be nice to use Blaze here, but it's a little tricky
// because our mustaches would be inside a <script> tag, and Blaze
// would treat the <script> tag contents as text (e.g. encode '&' as
// '&'). So we just do a simple replace.
- 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 partitionVersions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
CS.VersionPricer.prototype.partitionVersions = function (versions, target) {
var self = this;
var firstGteIndex = versions.length;
var higherMajorIndex = versions.length;
var targetVInfo = self.getVersionInfo(target);
- 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 loadSingleVersion
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
CS.CatalogLoader.prototype.loadSingleVersion = function (pkg, version) {
var self = this;
var cache = self.catalogCache;
if (! cache.hasPackageVersion(pkg, version)) {
var rec;
- 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 visitCallExpression
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
visitCallExpression(path) {
const node = path.getValue();
if (hasIdWithName(node.callee, this.name)) {
const source = this.source;
- 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 _expireTokens
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_expireTokens(oldestValidDate, userId) {
const tokenLifetimeMs = this._getTokenLifetimeMs();
// when calling from a test with extra arguments, you must specify both!
if ((oldestValidDate && !userId) || (!oldestValidDate && userId)) {
- 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 stringForErrorMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const stringForErrorMessage = (value, options = {}) => {
if ( value === null ) {
return 'null';
}
- 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 _constructCsp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_constructCsp: function () {
if (! cspSrcs || (Object.keys(cspSrcs).length === 0 && cspSrcs.constructor === Object))
return null;
if (cachedCsp)
- 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 getTrueVars
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Logic.Solution.prototype.getTrueVars = function () {
var solver = this._solver;
var assignment = this._assignment;
var result = [];
for (var i = 1; i < assignment.length; i++) {
- 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 connect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function connect(...connectArgs) {
const handlers = npmConnect.apply(this, connectArgs);
const originalUse = handlers.use;
// Wrap the handlers.use method so that any provided handler functions
- 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 getVarNum
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Logic.Solver.prototype.getVarNum = function (vname, noCreate, _createInternals) {
var key = ' '+vname;
if (has(this._name2num, key)) {
return this._name2num[key];
} else if (noCreate) {
- 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 registerExportsForReactRefresh
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function registerExportsForReactRefresh(moduleId, moduleExports) {
runtime.register(moduleExports, moduleId + ' %exports%');
if (moduleExports == null || typeof moduleExports !== 'object') {
// Exit if we can't iterate over exports.
- 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 getFormula
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Logic.Solution.prototype.getFormula = function () {
var solver = this._solver;
var assignment = this._assignment;
var terms = [];
for (var i = 1; i < assignment.length; i++) {
- 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"