sebastian-software/core

View on GitHub

Showing 406 of 406 total issues

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

  else if (transformProperty)
  {
    var render = function(left, top, zoom)
    {
      var content = this.__container.firstElementChild;
Severity: Major
Found in source/class/core/component/Scroller.js and 1 other location - About 2 hrs to fix
source/class/core/component/Scroller.js on lines 7..32

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 77.

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 Array.js has 254 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
==================================================================================================
  Core - JavaScript Foundation
  Copyright 2012-2014 Sebastian Werner
==================================================================================================
Severity: Minor
Found in source/class/core/model/Array.js - About 2 hrs to fix

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

      scrollX : function(element, align)
      {
        var parent = element.parentNode;
        var doc = element.ownerDocument;
        var body = doc.body;
    Severity: Minor
    Found in source/class/core/bom/ScrollInto.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 walk has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function walk(node, labels, nostrip)
        {
            var code = '';
    
            for (var i=0, l=node.length; i<l; i++)
    Severity: Major
    Found in source/class/core/template/Compiler.js - About 2 hrs to fix

      Function setter has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  var setter = function(modifyPriority)
                  {
                      return function(newValue)
                      {
                          var context = this;
      Severity: Minor
      Found in source/class/core/property/Multi.js - About 2 hrs to fix

        Function fadeOut has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            fadeOut : function(elem, to, reset, callback, context)
            {
              // Already running
              if (elem.fading == "out") {
                return;
        Severity: Minor
        Found in source/class/core/bom/Transition.js - About 1 hr to fix

          Function checkSetter has 49 lines of code (exceeds 25 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 1 hr to fix

            Function __publish has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                __publish: function(left, top, zoom, animate) {
            
                  var self = this;
            
                  // Remember whether we had an animation, then we try to continue based on the current "drive" of the animation
            Severity: Minor
            Found in source/class/core/ui/Scroller.js - About 1 hr to fix

              Function load has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      load : function(uri, callback, context, nocache, timeout)
                      {
                          if (!context) {
                              context = global;
                          }
              Severity: Minor
              Found in source/class/core/io/Text.js - About 1 hr to fix

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

                            if (jasy.Env.isSet("debug"))
                            {
                                core.Assert.isType(array, "Array");
                                core.Assert.isType(callback, "Function");
                
                
                Severity: Major
                Found in source/class/core/Array.js and 4 other locations - About 1 hr to fix
                source/class/core/Array.js on lines 95..103
                source/class/core/Array.js on lines 154..162
                source/class/core/Array.js on lines 270..278
                source/class/core/Array.js on lines 401..409

                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 74.

                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 5 locations. Consider refactoring.
                Open

                            if (jasy.Env.isSet("debug"))
                            {
                                core.Assert.isType(array, "Array");
                                core.Assert.isType(callback, "Function");
                
                
                Severity: Major
                Found in source/class/core/Array.js and 4 other locations - About 1 hr to fix
                source/class/core/Array.js on lines 95..103
                source/class/core/Array.js on lines 154..162
                source/class/core/Array.js on lines 187..195
                source/class/core/Array.js on lines 270..278

                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 74.

                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 5 locations. Consider refactoring.
                Open

                            if (jasy.Env.isSet("debug"))
                            {
                                core.Assert.isType(array, "Array");
                                core.Assert.isType(callback, "Function");
                
                
                Severity: Major
                Found in source/class/core/Array.js and 4 other locations - About 1 hr to fix
                source/class/core/Array.js on lines 154..162
                source/class/core/Array.js on lines 187..195
                source/class/core/Array.js on lines 270..278
                source/class/core/Array.js on lines 401..409

                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 74.

                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 5 locations. Consider refactoring.
                Open

                            if (jasy.Env.isSet("debug"))
                            {
                                core.Assert.isType(array, "Array");
                                core.Assert.isType(callback, "Function");
                
                
                Severity: Major
                Found in source/class/core/Array.js and 4 other locations - About 1 hr to fix
                source/class/core/Array.js on lines 95..103
                source/class/core/Array.js on lines 154..162
                source/class/core/Array.js on lines 187..195
                source/class/core/Array.js on lines 401..409

                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 74.

                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 5 locations. Consider refactoring.
                Open

                            if (jasy.Env.isSet("debug"))
                            {
                                core.Assert.isType(array, "Array");
                                core.Assert.isType(callback, "Function");
                
                
                Severity: Major
                Found in source/class/core/Array.js and 4 other locations - About 1 hr to fix
                source/class/core/Array.js on lines 95..103
                source/class/core/Array.js on lines 187..195
                source/class/core/Array.js on lines 270..278
                source/class/core/Array.js on lines 401..409

                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 74.

                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

                    easeInOutQuart: function(pos) {
                        if ((pos /= 0.5) < 1) {
                            return 0.5 * Math.pow(pos, 4);
                        }
                
                
                Severity: Major
                Found in source/class/core/effect/Easing.js and 1 other location - About 1 hr to fix
                source/class/core/effect/Easing.js on lines 308..314

                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 74.

                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

                    easeFromTo: function(pos) {
                        if ((pos /= 0.5) < 1) {
                            return 0.5 * Math.pow(pos, 4);
                        }
                
                
                Severity: Major
                Found in source/class/core/effect/Easing.js and 1 other location - About 1 hr to fix
                source/class/core/effect/Easing.js on lines 88..94

                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 74.

                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 map has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var map = function(promisesOrValues, mapFunction, context)
                  {
                    if (jasy.Env.isSet("debug"))
                    {
                      core.Assert.isType(mapFunction, "Function", "Flow control map() requires second parameter to be an mapping function!");
                Severity: Minor
                Found in source/class/core/event/Flow.js - About 1 hr to fix

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

                    scrollY : function(element, align)
                    {
                      var parent = element.parentNode;
                      var doc = element.ownerDocument;
                      var body = doc.body;
                  Severity: Minor
                  Found in source/class/core/bom/ScrollInto.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 decodeToArrayOfBytes has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var decodeToArrayOfBytes = function(arr) {
                          var result = [];
                          var current = 0;
                          var bitOffset = 0;
                          var charOffset = 0;
                  Severity: Minor
                  Found in source/class/core/util/Base62.js - About 1 hr to fix

                    Function isValid has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                isValid : function(property, raise)
                                {
                                    if (typeof property == "string")
                                    {
                                        var method = validators[property];
                    Severity: Minor
                    Found in source/class/core/property/MGeneric.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language