brean/gown.js

View on GitHub

Showing 79 of 271 total issues

Function throwTo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

Scroller.prototype.throwTo = function (targetHorizontalScrollPosition, targetVerticalScrollPosition, duration) {
    duration = duration || 500;

    var verticalScrollPosition = this._throwToTween(targetHorizontalScrollPosition, 'horizontal');
    var horizontalScrollPosition = this._throwToTween(targetVerticalScrollPosition, 'vertical');
Severity: Minor
Found in src/controls/Scroller.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 move has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

ScrollThumb.prototype.move = function(x, y) {
    if (this.scrollable.direction === GOWN.Scrollable.HORIZONTAL) {
        if (isNaN(x)) {
            return false;
        }
Severity: Minor
Found in src/controls/ScrollThumb.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 refreshScrollSteps has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

Scroller.prototype.refreshScrollSteps = function () {
    if (this.explicitHorizontalScrollStep !== this.explicitHorizontalScrollStep) //isNaN
    {
        if (this._viewPort) {
            this.actualHorizontalScrollStep = this._viewPort.horizontalScrollStep;
Severity: Minor
Found in src/controls/Scroller.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 throwTo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Scroller.prototype.throwTo = function (targetHorizontalScrollPosition, targetVerticalScrollPosition, duration) {
    duration = duration || 500;

    var verticalScrollPosition = this._throwToTween(targetHorizontalScrollPosition, 'horizontal');
    var horizontalScrollPosition = this._throwToTween(targetVerticalScrollPosition, 'vertical');
Severity: Minor
Found in src/controls/Scroller.js - About 1 hr to fix

    Function refreshMask has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Scroller.prototype.refreshMask = function () {
        if (!this._clipContent) {
            if (this._viewPort) {
                this._viewPort.mask = null;
            }
    Severity: Minor
    Found in src/controls/Scroller.js - About 1 hr to fix

      Function skinFromData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      ThemeParser.prototype.skinFromData = function(skinData, data) {
          if (skinData.type === 'texture') {
              var scale9;
              if (skinData.scale9 && skinData.scale9 in data.grids) {
                  scale9 = this.getScale9(data.grids[skinData.scale9]);
      Severity: Minor
      Found in src/skin/ThemeParser.js - About 1 hr to fix

        Function _updateProgressSkin has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Scrollable.prototype._updateProgressSkin = function() {
            if (!this.progressSkin) {
                return;
            }
            if(this.direction === Scrollable.HORIZONTAL) {
        Severity: Minor
        Found in src/controls/Scrollable.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if (this.verticalScrollBar && (this._measureViewPort || useActualBounds)) {
                  var scrollerHeight = useActualBounds ? this.actualHeight : this._explicitHeight;
                  var totalHeight = this._viewPort.height + this._viewPortOffset.top + this._viewPortOffset.bottom;
                  this._hasVerticalScrollBar =
                      forceScrollBars || this._verticalScrollPolicy === Scroller.SCROLL_POLICY_ON ||
          Severity: Major
          Found in src/controls/Scroller.js - About 1 hr to fix

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

            ScaleContainer.prototype._positionTilable = function() {
                // left / middle / right width
                var lw = this.rect.x;
                var mw = this.rect.width;
                var rw = this.frame.width - (mw + lw);
            Severity: Minor
            Found in src/utils/ScaleContainer.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 drawResults has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            AutoComplete.prototype.drawResults = function (text) {
                if (text.length < this._minAutoCompleteLength) {
                    this.results = [];
                } else {
                    var lowerCaseText = text.toString().toLowerCase();
            Severity: Minor
            Found in src/controls/AutoComplete.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 _updateProgressSkin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

            Scrollable.prototype._updateProgressSkin = function() {
                if (!this.progressSkin) {
                    return;
                }
                if(this.direction === Scrollable.HORIZONTAL) {
            Severity: Minor
            Found in src/controls/Scrollable.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 Application has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function Application(config, screenMode, parentId, width, height, renderer, stage) {
            Severity: Major
            Found in src/controls/Application.js - About 50 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if (data.configurable === undefined) {
                                       // We change our default case, so that we can
                                       // overwrite properties later on
                                      data.configurable = true;
                                  }
              Severity: Major
              Found in src/utils/mixin.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if (isinstance(value, dict)):
                                        data.setdefault(key, value)
                                        data[key].update(user_data[key])
                                    else:
                                        data[key] = value
                Severity: Major
                Found in themes/from_feathers/get_themes.py - About 45 mins to fix

                  Function redraw has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Scrollable.prototype.redraw = function() {
                      if (this.thumbFactoryInvalid) {
                          this.createThumb();
                          this.thumbFactoryInvalid = false;
                      }
                  Severity: Minor
                  Found in src/controls/Scrollable.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 Arrow has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  function Arrow(color, alpha, tailWidth, tailHeight, width, height) {
                  Severity: Minor
                  Found in src/shapes/Arrow.js - About 45 mins to fix

                    Function pixelToTextPos has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    InputControl.prototype.pixelToTextPos = function(pixelPos) {
                        var textPos = 0;
                        var lines = this.getLines();
                        // calculate current line we are in
                        var currentLine = Math.min(
                    Severity: Minor
                    Found in src/controls/InputControl.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 skinFromData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    ThemeParser.prototype.skinFromData = function(skinData, data) {
                        if (skinData.type === 'texture') {
                            var scale9;
                            if (skinData.scale9 && skinData.scale9 in data.grids) {
                                scale9 = this.getScale9(data.grids[skinData.scale9]);
                    Severity: Minor
                    Found in src/skin/ThemeParser.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 Line has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    function Line(color, alpha, width, height, lineWidth, reverse) {
                    Severity: Minor
                    Found in src/shapes/Line.js - About 45 mins to fix

                      Function calculateViewPortOffsetsForFixedVerticalScrollBar has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      Scroller.prototype.calculateViewPortOffsetsForFixedVerticalScrollBar = function (forceScrollBars, useActualBounds) {
                          forceScrollBars = forceScrollBars || false;
                          useActualBounds = useActualBounds || false;
                          if (this.verticalScrollBar && (this._measureViewPort || useActualBounds)) {
                              var scrollerHeight = useActualBounds ? this.actualHeight : this._explicitHeight;
                      Severity: Minor
                      Found in src/controls/Scroller.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

                      Severity
                      Category
                      Status
                      Source
                      Language