Showing 22 of 119 total issues
Function default
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
export default function<T>(calculator: ICalculator<T>, args: any[], writeCallback?: IWriteCallback<T>): IComputed<T> {
let currentValue: T;
let oldValue: T;
let dependencies: IDependency[];
- Read upRead up
- Create a ticketCreate a ticket
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 default
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function<T>(calculator: ICalculator<T>, args: any[], writeCallback?: IWriteCallback<T>): IComputed<T> {
let currentValue: T;
let oldValue: T;
let dependencies: IDependency[];
- Create a ticketCreate a ticket
Function describeUsageSyntax
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
var describeUsageSyntax = function(invokeComputed) {
var describeCalledWithParameters = function(expectCalls, parameterValue, parameterName) {
var parameters = [parameterValue];
var observableValue;
var originalValue;
- Create a ticketCreate a ticket
Function exports
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(updatesCount, dependenciesCount) {
Benchmark.prototype.args = {
updatesCount: updatesCount,
dependenciesCount: dependenciesCount,
ko: ko,
- Create a ticketCreate a ticket
Function exports
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(updatesCount, dependenciesCount) {
Benchmark.prototype.args = {
updatesCount: updatesCount,
dependenciesCount: dependenciesCount,
ko: ko,
- Read upRead up
- Create a ticketCreate a ticket
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 describeCalledWithParameters
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
var describeCalledWithParameters = function(parameterValue, parameterName) {
var parameters = [parameterValue];
var observableValue;
var originalValue;
var computedValueWithArgs;
- Create a ticketCreate a ticket
Function describeCalledWithParameters
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
var describeCalledWithParameters = function(expectCalls, parameterValue, parameterName) {
var parameters = [parameterValue];
var observableValue;
var originalValue;
- Create a ticketCreate a ticket
Function setup
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Benchmark.prototype.setup = function() {
var updatesCount = this.args.updatesCount;
var dependenciesCount = this.args.dependenciesCount;
var ko = this.args.ko;
var itDepends = this.args.itDepends;
- Create a ticketCreate a ticket
Function describeUsageSyntax
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
var describeUsageSyntax = function(invokeComputed) {
var defineTest = function(i) {
var values = exampleValues[i];
var valuesString = stringify(values);
- Create a ticketCreate a ticket
Function default
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function<T>(stateListener?: IStateListener): ISubscriptions<T> {
interface ILinkedListItem {
next: ILinkedListItem;
prev: ILinkedListItem;
handler?: IChangeHandler<T>;
- Create a ticketCreate a ticket
Function default
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export default function<T>(calculator: ICalculator<T>, writeCallback?: IWriteCallback<T>): IParametricComputed<T> {
const cache: IComputedHash = {};
const allArguments = [];
const self = <IParametricComputedValue<T>>read;
- Read upRead up
- Create a ticketCreate a ticket
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 default
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export default function<T>(stateListener?: IStateListener): ISubscriptions<T> {
interface ILinkedListItem {
next: ILinkedListItem;
prev: ILinkedListItem;
handler?: IChangeHandler<T>;
- Read upRead up
- Create a ticketCreate a ticket
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 defineTest
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
var defineTest = function(i) {
var values = exampleValues[i];
var valuesString = stringify(values);
it('should calculate when requested with values ' + valuesString, function () {
- Create a ticketCreate a ticket
Function default
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function<T>(calculator: ICalculator<T>, writeCallback?: IWriteCallback<T>): IParametricComputed<T> {
const cache: IComputedHash = {};
const allArguments = [];
const self = <IParametricComputedValue<T>>read;
- Create a ticketCreate a ticket
Function executeCalculator
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function executeCalculator(): void {
const dependenciesById: IDependencyHash = {};
const oldDependencies = dependencies;
dependencies = [];
- Create a ticketCreate a ticket
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(updatesCount, subscribersCount) {
Benchmark.prototype.args = {
updatesCount: updatesCount,
subscribersCount: subscribersCount,
ko: ko,
- Create a ticketCreate a ticket
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(subscribersCount) {
Benchmark.prototype.args = {
subscribersCount: subscribersCount,
ko: ko,
itDepends: itDepends
- Create a ticketCreate a ticket
Function exports
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(subscribersCount) {
Benchmark.prototype.args = {
subscribersCount: subscribersCount,
ko: ko,
itDepends: itDepends
- Create a ticketCreate a ticket
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(updatesCount, subscribersCount) {
Benchmark.prototype.args = {
updatesCount: updatesCount,
subscribersCount: subscribersCount,
ko: ko,
- Create a ticketCreate a ticket
Function default
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function<T>(initialValue: T): IValue<T> {
const id = tracking.takeNextObservableId();
let currentValue = initialValue;
let subscriptions: ISubscriptions<T>;
- Create a ticketCreate a ticket