gerich-home/it-depends

View on GitHub

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[];
Severity: Minor
Found in src/computed.ts - About 7 hrs to fix

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[];
Severity: Major
Found in src/computed.ts - About 4 hrs to fix

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;
Severity: Major
Found in specs/parametricComputedWithValueDependency.js - About 3 hrs to fix

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,
Severity: Major
Found in performance-tests/scenarios/computedDiamondUpdate.js - About 3 hrs to fix

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,
Severity: Minor
Found in performance-tests/scenarios/computedDiamondUpdate.js - About 3 hrs to fix

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;
Severity: Major
Found in specs/parametricComputedChangeCallback.js - About 3 hrs to fix

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;
            
Severity: Major
Found in specs/parametricComputedWithValueDependency.js - About 2 hrs to fix

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;
Severity: Major
Found in performance-tests/scenarios/computedDiamondUpdate.js - About 2 hrs to fix

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);
            
Severity: Major
Found in specs/parametricComputedWithNoDependencies.js - About 2 hrs to fix

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>;
Severity: Major
Found in src/subscriptionList.ts - About 2 hrs to fix

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;
Severity: Minor
Found in src/parametricComputed.ts - About 2 hrs to fix

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>;
Severity: Minor
Found in src/subscriptionList.ts - About 2 hrs to fix

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 () {
Severity: Major
Found in specs/parametricComputedWithNoDependencies.js - About 2 hrs to fix

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;
Severity: Minor
Found in src/parametricComputed.ts - About 1 hr to fix

Function executeCalculator has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function executeCalculator(): void {
        const dependenciesById: IDependencyHash = {};

        const oldDependencies = dependencies;
        dependencies = [];
Severity: Minor
Found in src/computed.ts - About 1 hr to fix

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,
Severity: Minor
Found in performance-tests/scenarios/computedUpdates.js - About 1 hr to fix

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
Severity: Minor
Found in performance-tests/scenarios/computedSubscription.js - About 1 hr to fix

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
Severity: Minor
Found in performance-tests/scenarios/observableSubscription.js - About 1 hr to fix

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,
Severity: Minor
Found in performance-tests/scenarios/observableWriteWithSubscription.js - About 1 hr to fix

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>;
Severity: Minor
Found in src/value.ts - About 1 hr to fix
Severity
Category
Status
Source
Language