sebastian-software/core

View on GitHub

Showing 229 of 406 total issues

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

/*
 * Scroller
 * http://github.com/zynga/scroller
 *
 * Copyright 2013, Sebastian Werner
Severity: Major
Found in source/class/core/ui/Scroller.js - About 1 day to fix

    File Multi.js has 524 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    ==================================================================================================
      Core - JavaScript Foundation
      Copyright 2010-2012 Zynga Inc.
      Copyright 2012-2014 Sebastian Werner
    Severity: Major
    Found in source/class/core/property/Multi.js - About 1 day to fix

      Function create has 200 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              create : function(config)
              {
                  /*
                  ---------------------------------------------------------------------------
                       INTRO: IDENTICAL BETWEEN SIMPLE AND MULTI
      Severity: Major
      Found in source/class/core/property/Multi.js - About 1 day to fix

        Function create has 194 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                create : function(config)
                {
                    /*
                    ---------------------------------------------------------------------------
                        INTRO
        Severity: Major
        Found in source/class/core/property/Simple.js - About 7 hrs to fix

          Function add has 164 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              add : function(target, type, callback, context, capture)
              {
                var specialHandler = special[type];
                if (specialHandler) {
                  return specialHandler.add(target, type, callback, context, capture);
          Severity: Major
          Found in source/class/core/bom/PointerEvent.js - About 6 hrs to fix

            Function getData has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
            Open

                getData : function(form)
                {
                    if (jasy.Env.isSet("debug"))
                    {
                        core.Assert.isEqual(arguments.length, 1);
            Severity: Minor
            Found in source/class/core/bom/Form.js - About 4 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 load has 111 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    load : function(uris, callback, context, nocache, type)
                    {
                        if (jasy.Env.isSet("debug"))
                        {
                            core.Assert.isType(uris, "Array");
            Severity: Major
            Found in source/class/core/io/Queue.js - About 4 hrs to fix

              Function detect has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
              Open

                detect : function(data)
                {
                  return new core.event.Promise(function(resolve, reject) {
                    var url = "//maps.googleapis.com/maps/api/geocode/json?sensor=true&latlng=";
                    url += data.latitude + "," + data.longitude;
              Severity: Minor
              Found in source/class/core/service/location/GeoCode.js - About 4 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

              File Class.js has 349 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
              ==================================================================================================
                  Core - JavaScript Foundation
                  Copyright 2010-2012 Zynga Inc.
                  Copyright 2012-2014 Sebastian Werner
              Severity: Minor
              Found in source/class/core/Class.js - About 4 hrs to fix

                `` has 34 functions (exceeds 20 allowed). Consider refactoring.
                Open

                {
                    /**
                     * {Number} Transforms a position (@pos {Number}) between 0 (start of effect) and 1 (end of effect) into a effect modified one.
                     */
                    easeInQuad: function(pos) {
                Severity: Minor
                Found in source/class/core/effect/Easing.js - About 4 hrs to fix

                  Function __onLoad has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                          __onLoad : function() {
                  
                              document.body.addEventListener('click', function(event) {
                  
                                  var element = event.target;
                  Severity: Minor
                  Found in source/class/core/apibrowser/Browser.js - About 4 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 __showContent has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                          __showContent: function(data, doToggle) {
                  
                              if (data.file) {
                  
                                  var content = document.getElementById('content'),
                  Severity: Minor
                  Found in source/class/core/apibrowser/Browser.js - About 4 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 importData has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          importData : function(obj, values, oldValues, field)
                          {
                              // Check existence of data structure
                              var data = obj[store];
                              if (!data) {
                  Severity: Major
                  Found in source/class/core/property/Multi.js - About 3 hrs to fix

                    Function doTouchMove has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        doTouchMove: function(touches, timeStamp, scale) {
                    
                          // Array-like check is enough here
                          if (touches.length == null) {
                            throw new Error("Invalid touch list: " + touches);
                    Severity: Major
                    Found in source/class/core/ui/Scroller.js - About 3 hrs to fix

                      Function checkSetter has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                      Open

                          checkSetter : function(obj, config, args)
                          {
                              var name = config.name;
                      
                              if (args.length == 0) {
                      Severity: Minor
                      Found in source/class/core/property/Debug.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

                      File JSON.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                      ==================================================================================================
                        Core - JavaScript Foundation
                        Copyright 2010-2012 Zynga Inc.
                        Copyright 2012-2014 Sebastian Werner
                      Severity: Minor
                      Found in source/class/core/JSON.js - About 3 hrs to fix

                        Function lex has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              var lex = function () {
                                var source = Source, length = source.length, symbol, value, begin, position, sign;
                                while (Index < length) {
                                  symbol = source.charAt(Index);
                                  if ("\t\r\n ".indexOf(symbol) > -1) {
                        Severity: Major
                        Found in source/class/core/JSON.js - About 3 hrs to fix

                          Function assert has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  assert : function(objectOrClass, iface)
                                  {
                                      if (!objectOrClass) {
                                          throw new Error("Invalid class or object to verify interface with: " + objectOrClass);
                                      }
                          Severity: Major
                          Found in source/class/core/Interface.js - About 3 hrs to fix

                            File Asset.js has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*
                            ==================================================================================================
                                Core - JavaScript Foundation
                                Copyright 2010-2012 Zynga Inc.
                                Copyright 2012-2014 Sebastian Werner
                            Severity: Minor
                            Found in source/class/core/io/Asset.js - About 3 hrs to fix

                              Function getValue has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  getValue : function(item)
                                  {
                                      if (jasy.Env.isSet("debug"))
                                      {
                                          core.Assert.isEqual(arguments.length, 1);
                              Severity: Minor
                              Found in source/class/core/bom/FormItem.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

                              Severity
                              Category
                              Status
                              Source
                              Language