GreyRook/gown.js

View on GitHub

Showing 79 of 271 total issues

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

    Function Rect has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function Rect(color, alpha, width, height, radius) {
    Severity: Minor
    Found in src/shapes/Rect.js - About 35 mins to fix

      Function childIsRenderAble has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      LayoutGroup.prototype.childIsRenderAble = function(child, x, y, width, height) {
      Severity: Minor
      Found in src/controls/LayoutGroup.js - About 35 mins to fix

        Function drawCursor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        InputControl.prototype.drawCursor = function () {
            // TODO: use Tween instead!
            if (this.hasFocus || this._mouseDown) {
                var time = Date.now();
        
        
        Severity: Minor
        Found in src/controls/InputControl.js - About 35 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 refreshRenderers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        List.prototype.refreshRenderers = function () {
            //TODO: update only new renderer
            //      see ListDataViewPort --> refreshInactieRenderers
            this._itemRenderer.length = 0;
            if (this._dataProvider && this.viewPort) {
        Severity: Minor
        Found in src/controls/List.js - About 35 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 get_feathers_themes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        def get_feathers_themes(feathers_themes_path):
            theme_data = {}
            themes = os.listdir(feathers_themes_path)
        
            # find Base<name>.as-Files to extract scale_9_grid values
        Severity: Minor
        Found in themes/from_feathers/get_themes.py - About 35 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 setCursorPos has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        InputWrapper.setCursorPos = function (pos) {
            if (InputWrapper.hiddenInput) {
                var elem = InputWrapper.hiddenInput;
                if(elem.createTextRange) {
                    var range = elem.createTextRange();
        Severity: Minor
        Found in src/utils/InputWrapper.js - About 35 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 onResize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        ResizeManager.prototype.onResize = function (_event) {
            if (!this.element && this.fullscreen === false) {
                // we assume you have a fixed size?!
                // TODO: do not add resizeManager in the first place?
                return;
        Severity: Minor
        Found in src/interaction/ResizeManager.js - About 35 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

        Avoid too many return statements within this function.
        Open

            return false;
        Severity: Major
        Found in src/controls/ScrollThumb.js - About 30 mins to fix

          Function textToPixelPos has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          InputControl.prototype.textToPixelPos = function(textPos, position) {
              var lines = this.getLines();
              var x = 0;
              for (var y = 0; y < lines.length; y++) {
                  var lineLength = lines[y].length;
          Severity: Minor
          Found in src/controls/InputControl.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

          Function handlePendingScroll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          Scroller.prototype.handlePendingScroll = function () {
              if (!isNaN(this.pendingHorizontalScrollPosition) || !isNaN(this.pendingVerticalScrollPosition)) {
                  this.throwTo(this.pendingHorizontalScrollPosition, this.pendingVerticalScrollPosition, this.pendingScrollDuration);
                  this.pendingHorizontalScrollPosition = NaN;
                  this.pendingVerticalScrollPosition = NaN;
          Severity: Minor
          Found in src/controls/Scroller.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

          Function refreshMask has a Cognitive Complexity of 6 (exceeds 5 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 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

          Function set has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              set: function(inverse) {
                  if (inverse !== this._inverse) {
                      this._inverse = inverse;
          
                      if (this.direction === Scrollable.HORIZONTAL) {
          Severity: Minor
          Found in src/controls/Scrollable.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

          Function addItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          ToggleGroup.prototype.addItem = function(item) {
              if (this._items.indexOf(item) === -1) {
                  this._items.push(item);
                  item.on(ToggleButton.CHANGE, this._toggleChanged, this);
                  // new radio button is selected, unselect the old one
          Severity: Minor
          Found in src/controls/ToggleGroup.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

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

              redraw: function() {
                  // remove last skin after new one has been added
                  // (just before rendering, otherwise we would see nothing for a frame)
                  if (this._lastSkin) {
                      //this.removeChild(this._lastSkin);
          Severity: Minor
          Found in src/utils/resizeScaling.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

          Function setMaxLength has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          InputWrapper.setMaxLength = function(length) {
              if (InputWrapper.hiddenInput) {
                  if (!length || length < 0) {
                      InputWrapper.hiddenInput.removeAttribute('maxlength');
                  } else {
          Severity: Minor
          Found in src/utils/InputWrapper.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

          Function textToLinePos has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          TextArea.prototype.textToLinePos = function(textPos, position) {
              var lines = this.getLines();
              var x = 0;
              for (var y = 0; y < lines.length; y++) {
                  var lineLength = lines[y].length;
          Severity: Minor
          Found in src/controls/TextArea.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

          Function updateDimensions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          Button.prototype.updateDimensions = function() {
              var width = this.worldWidth;
              var height = this.worldHeight;
              if (this.hitArea) {
                  this.hitArea.width = width;
          Severity: Minor
          Found in src/controls/Button.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

          Function fromSkin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          Skinable.prototype.fromSkin = function(name, callback) {
              var skin;
              if (this.skinCache[name]) {
                  skin = this.skinCache[name];
              } else {
          Severity: Minor
          Found in src/core/Skinable.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

          Severity
          Category
          Status
          Source
          Language