sebastian-software/core

View on GitHub

Showing 406 of 406 total issues

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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (jasy.Env.isSet("debug"))
                    {
                        core.Assert.isType(uri, "String");
        
                        if (callback != null) {
        Severity: Major
        Found in source/class/core/io/Image.js and 1 other location - About 4 hrs to fix
        source/class/core/io/Script.js on lines 63..78

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 118.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    if (jasy.Env.isSet("debug"))
                    {
                        core.Assert.isType(uri, "String");
        
                        if (callback != null) {
        Severity: Major
        Found in source/class/core/io/Script.js and 1 other location - About 4 hrs to fix
        source/class/core/io/Image.js on lines 30..45

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 118.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  if (typeof property == "string")
                                  {
                                      var method = getters[property];
                                      if (!method) {
                                          method = getters[property] = "get" + up(property);
                  Severity: Major
                  Found in source/class/core/property/MGeneric.js and 1 other location - About 3 hrs to fix
                  source/class/core/property/MGeneric.js on lines 166..204

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 109.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  if (typeof property == "string")
                                  {
                                      var method = resetters[property];
                                      if (!method) {
                                          method = resetters[property] = "reset" + up(property);
                  Severity: Major
                  Found in source/class/core/property/MGeneric.js and 1 other location - About 3 hrs to fix
                  source/class/core/property/MGeneric.js on lines 110..152

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 109.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                                          if (newValue !== oldValue)
                                          {
                                              // Call apply
                                              if (propertyApply) {
                                                  context[propertyApply](newValue, oldValue, config.name);
                  Severity: Major
                  Found in source/class/core/property/Multi.js and 1 other location - About 3 hrs to fix
                  source/class/core/property/Multi.js on lines 418..437

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 109.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                                      if (oldPriority === modifyPriority && oldValue !== newValue)
                                      {
                                          // Call apply
                                          if (propertyApply) {
                                              context[propertyApply](newValue, oldValue, config.name);
                  Severity: Major
                  Found in source/class/core/property/Multi.js and 1 other location - About 3 hrs to fix
                  source/class/core/property/Multi.js on lines 319..338

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 109.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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
                    Severity
                    Category
                    Status
                    Source
                    Language