sebastian-software/core

View on GitHub

Showing 406 of 406 total issues

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

            if (jasy.Env.isSet("debug"))
            {
                if (!entry) {
                    throw new Error("Unknown image: " + id);
                }
Severity: Major
Found in source/class/core/io/Asset.js and 2 other locations - About 1 hr to fix
source/class/core/io/Asset.js on lines 288..297
source/class/core/io/Asset.js on lines 315..324

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

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

    function safeAdd(x, y)
    {
        var lsw = (x & 0xFFFF) + (y & 0xFFFF);
        var msw = (x >> 16) + (y >> 16) + (lsw >> 16);

Severity: Major
Found in source/class/core/crypt/SHA256.js and 2 other locations - About 1 hr to fix
source/class/core/crypt/MD5.js on lines 205..211
source/class/core/crypt/SHA1.js on lines 158..164

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

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

    sequence : function(tasks, context, arg1)
    {
      if (jasy.Env.isSet("debug"))
      {
        core.Assert.isType(tasks, "Array");
Severity: Minor
Found in source/class/core/event/Flow.js - About 1 hr to fix

    Function set has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                members.set = function(value)
                {
                    var context=this, data, old;
    
                    // Wrap plain types to match property type
    Severity: Minor
    Found in source/class/core/property/Simple.js - About 1 hr to fix

      Function construct has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          construct: function()
          {
              this.__headElem = document.createElement("div");
              this.__headElem.id = "head";
              this.__headElem.innerHTML = "API Documentation";
      Severity: Minor
      Found in source/class/core/apibrowser/Browser.js - About 1 hr to fix

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

                    if (jasy.Env.isSet("debug"))
                    {
                        core.Assert.isType(render, "Function", "Missing valid render method!");
        
                        if (name != null) {
        Severity: Major
        Found in source/class/core/template/Template.js and 1 other location - About 1 hr to fix
        source/class/core/template/Parser.js on lines 89..96

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

        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

          getInnerHeight : function(element) {
            return element.clientHeight - core.bom.Style.getInteger(element, "paddingTop", true) - core.bom.Style.getInteger(element, "paddingBottom", true);
          }
        Severity: Major
        Found in source/class/core/bom/Dimension.js and 1 other location - About 1 hr to fix
        source/class/core/bom/Dimension.js on lines 18..20

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

        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

          getInnerWidth : function(element) {
            return element.clientWidth - core.bom.Style.getInteger(element, "paddingLeft", true) - core.bom.Style.getInteger(element, "paddingRight", true);
          },
        Severity: Major
        Found in source/class/core/bom/Dimension.js and 1 other location - About 1 hr to fix
        source/class/core/bom/Dimension.js on lines 26..28

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

        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

                max : function(array)
                {
                    if (jasy.Env.isSet("debug")) {
                        core.Assert.isType(array, "Array");
                    }
        Severity: Major
        Found in source/class/core/Array.js and 1 other location - About 1 hr to fix
        source/class/core/Array.js on lines 311..318

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

        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

                min : function(array)
                {
                    if (jasy.Env.isSet("debug")) {
                        core.Assert.isType(array, "Array");
                    }
        Severity: Major
        Found in source/class/core/Array.js and 1 other location - About 1 hr to fix
        source/class/core/Array.js on lines 298..305

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

        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 (jasy.Env.isSet("debug"))
                    {
                        core.Assert.isType(text, "String", "Template text must be type of string.");
        
                        if (nostrip != null) {
        Severity: Major
        Found in source/class/core/template/Parser.js and 1 other location - About 1 hr to fix
        source/class/core/template/Template.js on lines 100..107

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

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

                    get : function(property)
                    {
                        if (typeof property == "string")
                        {
                            var method = getters[property];
        Severity: Minor
        Found in source/class/core/property/MGeneric.js - About 1 hr to fix

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

            Function binb has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function binb(x, len)
                {
                    /* append padding */
                    x[len >> 5] |= 0x80 << (24 - len % 32);
                    x[((len + 64 >> 9) << 4) + 15] = len;
            Severity: Minor
            Found in source/class/core/crypt/SHA1.js - About 1 hr to fix

              Function VALUE has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  VALUE : (function(global, toString)
                  {
                      var engine;
              
                      if (jasy.Env.isSet("runtime", "browser"))
              Severity: Minor
              Found in source/class/core/detect/Engine.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 callback has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                      callback: function(data, id) {
              
                          if (core.String.endsWith(id, ".mustache")) {
              
                              var templateName = id.substring(0, id.indexOf(".mustache"));
              Severity: Minor
              Found in source/class/core/apibrowser/Browser.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 get has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  get : (function()
                  {
                      if (jasy.Env.isSet("runtime", "browser")) {
                          var items = location.search.substring(1).split("&");
                      } else {
              Severity: Minor
              Found in source/class/core/detect/Param.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 onreadystatechange has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    xhr.onreadystatechange = function()
                    {
                      if (xhr.readyState == 4)
                      {
                        try{
              Severity: Minor
              Found in source/class/core/service/location/GeoCode.js - About 1 hr to fix

                Function step has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            var step = function(virtual)
                            {
                                // Normalize virtual value
                                var render = virtual !== true;
                
                
                Severity: Minor
                Found in source/class/core/effect/Animate.js - About 1 hr to fix

                  Function encodeArrayOfBytes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var encodeArrayOfBytes = function(arr) {
                          // This works like a bit register. Take first 6 bits and push it to result. Take next 6 bits and so on.
                          // A special case is if the 6 bits represents 60, 61, 62 or 63. In this case one more bit is used to
                          // reduce 6 bit (= 64 different values) by two values.
                          var result = [];
                  Severity: Minor
                  Found in source/class/core/util/Base62.js - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language