GreyRook/gown.js

View on GitHub

Showing 79 of 271 total issues

File Scroller.js has 961 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var Control = require('../core/Control'),
    Tween = require('../utils/Tween'),
    Scrollable = require('./Scrollable'),
    ScrollBar = require('./ScrollBar');
// LayoutAlignment = require('../../external/pixi-layout/src/layout/LayoutAlignment');
Severity: Major
Found in src/controls/Scroller.js - About 2 days to fix

    Function layout has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
    Open

    TiledLayout.prototype.layout = function (items, maxWidth, maxHeight) {
        var _rows = this._orientation === TiledLayout.ORIENTATION_ROWS;
        if(items.length === 0) {
            return [0, 0];
        }
    Severity: Minor
    Found in src/layout/TiledLayout.js - About 1 day 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

    File InputControl.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var Skinable = require('../core/Skinable'),
        InputWrapper = require('../utils/InputWrapper');
    
    /**
     * InputControl used for TextInput, TextArea and everything else that
    Severity: Minor
    Found in src/controls/InputControl.js - About 5 hrs to fix

      Function layout has 134 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      TiledLayout.prototype.layout = function (items, maxWidth, maxHeight) {
          var _rows = this._orientation === TiledLayout.ORIENTATION_ROWS;
          if(items.length === 0) {
              return [0, 0];
          }
      Severity: Major
      Found in src/layout/TiledLayout.js - About 5 hrs to fix

        File Scrollable.js has 298 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var Skinable = require('../core/Skinable'),
            ScrollThumb = require('./ScrollThumb'),
            SliderData = require('../utils/SliderData');
        
        /**
        Severity: Minor
        Found in src/controls/Scrollable.js - About 3 hrs to fix

          Function refreshPageCount has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
          Open

          Scroller.prototype.refreshPageCount = function () {
              if (this._snapToPages) {
                  var horizontalScrollRange = this._maxHorizontalScrollPosition - this._minHorizontalScrollPosition;
                  var roundedDownRange;
                  if (horizontalScrollRange === Number.POSITIVE_INFINITY) {
          Severity: Minor
          Found in src/controls/Scroller.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 check has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def check(theme_assets):
              themes = os.listdir(theme_assets)
              for theme in themes:
                  scale_9_file = os.path.join(theme_assets, theme, theme+'_scale_9.json')
                  if not os.path.exists(scale_9_file):
          Severity: Minor
          Found in themes/from_feathers/sanity_check.py - 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 main has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          def main():
              parser = argparse.ArgumentParser(
                  description='Convert theme from feathers for gown.js.')
              parser.add_argument('feathers_path', type=str,
                                  help='path to feathers directory')
          Severity: Minor
          Found in themes/from_feathers/get_themes.py - 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 handleEvent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
          Open

          Button.prototype.handleEvent = function(type) {
              if (!this._enabled) {
                  return;
              }
              if (type === Button.DOWN || type === Button.TOUCHSTART) {
          Severity: Minor
          Found in src/controls/Button.js - 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 mouseWheelSupport has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

          function mouseWheelSupport(stage, enable) {
              var canvas = stage.canvas;
              if (enable || enable === undefined) {
                  if (GOWN._mouseWheelHandler !== undefined) {
                      return;
          Severity: Minor
          Found in src/utils/mouseWheelSupport.js - 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 ScaleContainer has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function ScaleContainer(texture, rect, middleWidth, centerHeight) {
              PIXI.Container.call( this );
          
              /**
               * The rectangle with position and dimensions of the center piece.
          Severity: Major
          Found in src/utils/ScaleContainer.js - About 2 hrs to fix

            Function parseData has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

            ThemeParser.prototype.parseData = function(data) {
                this.hoverSkin = data.hoverSkin;
                this.thumbSkin = data.thumbSkin;
                this.themeScale = data.themeScale || 1.0;
            
            
            Severity: Minor
            Found in src/skin/ThemeParser.js - 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 LoginDialog has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var LoginDialog = function() {
                GOWN.Control.call(this);
                // background
                this.bg = new GOWN.shapes.Rect(0x515151, 0.7, 200, 350, 5);
                this.addChild(this.bg);
            Severity: Major
            Found in docs/examples/example 13 - login dialog/js/LoginDialog.js - About 2 hrs to fix

              Function exports has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              module.exports = function(destination, source) {
                  for (var key in source) {
                      if (source.hasOwnProperty(key)) {
                          if(key === 'defineProperty') {
                              for (var name in source[key]) {
              Severity: Minor
              Found in src/utils/mixin.js - 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 checkForDrag has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              Scroller.prototype.checkForDrag = function (currentTouch) {
                  if (this._isScrollingStopped) {
                      return;
                  }
                  var horizontalMoved = Math.abs(currentTouch.x - this._startTouch.x);
              Severity: Minor
              Found in src/controls/Scroller.js - 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 Scroller has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function Scroller(theme) {
                  Control.call(this);
                  this.setTheme(theme);
                  this.interactive = true;
              
              
              Severity: Major
              Found in src/controls/Scroller.js - About 2 hrs to fix

                Function Application has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Application(config, screenMode, parentId, width, height, renderer, stage) {
                    screenMode = screenMode || Application.SCREEN_MODE_RESIZE;
                    var fullscreen = false;
                    var element = document.getElementById(parentId);
                    if (screenMode === Application.SCREEN_MODE_RESIZE) {
                Severity: Major
                Found in src/controls/Application.js - About 2 hrs to fix

                  Function Application has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function Application(config, screenMode, parentId, width, height, renderer, stage) {
                      screenMode = screenMode || Application.SCREEN_MODE_RESIZE;
                      var fullscreen = false;
                      var element = document.getElementById(parentId);
                      if (screenMode === Application.SCREEN_MODE_RESIZE) {
                  Severity: Minor
                  Found in src/controls/Application.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 updateTransform has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                      updateTransform: function() {
                          var wt = this.worldTransform;
                          var scaleX = 1;
                          var scaleY = 1;
                  
                  
                  Severity: Minor
                  Found in src/utils/resizeScaling.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 itemRendererChangeHandler has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                  List.prototype.itemRendererChangeHandler = function(itemRenderer, value) {
                      // TODO: update selected item
                      var i;
                      this._selectedIndices.length = 0;
                  
                  
                  Severity: Minor
                  Found in src/controls/List.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

                  Severity
                  Category
                  Status
                  Source
                  Language