Showing 9 of 9 total issues
Function Ably
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
var Ably = function Ably(namespace) {
var self = this;
function relayPendingSubscribers(test) {
var unmatchedSubscribers = [],
- 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 Ably
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Ably = function Ably(namespace) {
var self = this;
function relayPendingSubscribers(test) {
var unmatchedSubscribers = [],
Function defaultSampler
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
default: function defaultSampler(variants) {
return function() {
var total = 0,
current = 0,
random,
- 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 purgeOldExpositions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
ExpositionManager.prototype.purgeOldExpositions = function purgeOldExpositions(scope, cutoffDate) {
var data = scope.load();
if (data === null) {
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 Test
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Test = function Test(options) {
var self = this;
function notifySubscribers() {
var subscriber;
Function purgeOldExpositions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
ExpositionManager.prototype.purgeOldExpositions = function purgeOldExpositions(scope, cutoffDate) {
var data = scope.load();
if (data === null) {
return;
}
Function defaultSampler
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
default: function defaultSampler(variants) {
return function() {
var total = 0,
current = 0,
random,
Function Test
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var Test = function Test(options) {
var self = this;
function notifySubscribers() {
var subscriber;
- 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
Avoid too many return
statements within this function. Open
return expositions[test];