talho/openphin

View on GitHub
app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js

Summary

Maintainability
C
1 day
Test Coverage

Function buildHeaders has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    buildHeaders: function() {
        var tuples     = this.getTuples(),
            rowCount   = tuples.length,
            dimensions = this.dimensions,
            colCount   = dimensions.length,
Severity: Minor
Found in app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js - About 1 hr to fix

    Function buildHeaders has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        buildHeaders: function() {
            var tuples     = this.getTuples(),
                rowCount   = tuples.length,
                dimensions = this.dimensions,
                colCount   = dimensions.length,
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js - About 1 hr 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 getTuples has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getTuples: function() {
            var newStore = new Ext.data.Store({});
            
            newStore.data = this.store.data.clone();
            newStore.fields = this.store.fields;
    Severity: Minor
    Found in app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js - About 1 hr to fix

      Function renderVerticalRows has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          renderVerticalRows: function() {
              var headers  = this.buildHeaders(),
                  colCount = headers.length,
                  rowCells = [],
                  rows     = [],
      Severity: Minor
      Found in app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js - About 1 hr to fix

        Function renderVerticalRows has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            renderVerticalRows: function() {
                var headers  = this.buildHeaders(),
                    colCount = headers.length,
                    rowCells = [],
                    rows     = [],
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js - About 55 mins 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 getRecordInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            getRecordInfo: function(record) {
                var dimensions = this.dimensions,
                    length  = dimensions.length,
                    data    = {},
                    dimension, dataIndex, i;
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js - About 45 mins 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 getTuples has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            getTuples: function() {
                var newStore = new Ext.data.Store({});
                
                newStore.data = this.store.data.clone();
                newStore.fields = this.store.fields;
        Severity: Minor
        Found in app/assets/javascripts/ext/src/widgets/grid/PivotAxis.js - About 25 mins 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

        There are no issues that match your filters.

        Category
        Status