sebastian-software/core

View on GitHub

Showing 406 of 406 total issues

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

      if (suite.wasSuccessful()) {
        core.bom.ClassName.add(li, "successful");
      } else {
        core.bom.ClassName.add(li, "failed");
      }
Severity: Major
Found in source/class/core/testrunner/reporter/Html.js and 1 other location - About 1 hr to fix
source/class/core/testrunner/reporter/Html.js on lines 143..147

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

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 (test.wasSuccessful()) {
        core.bom.ClassName.add(li, "successful");
      } else {
        core.bom.ClassName.add(li, "failed");
      }
Severity: Major
Found in source/class/core/testrunner/reporter/Html.js and 1 other location - About 1 hr to fix
source/class/core/testrunner/reporter/Html.js on lines 112..116

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

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

    hide : function(approach)
    {
      var elem = this.getRoot();
      if (!elem) {
        return;
Severity: Major
Found in source/class/core/view/Dom.js and 1 other location - About 1 hr to fix
source/class/core/view/Dom.js on lines 166..175

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

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

            render: function(data, partials, labels)
            {
                if (jasy.Env.isSet("debug"))
                {
                    if (!(core.Main.isTypeOf(data, "Object") || core.Main.isTypeOf(data, "Array"))) {
Severity: Minor
Found in source/class/core/template/Template.js - About 1 hr to fix

    Function toISOString has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          toISOString : function()
          {
            var self = this;
            var result, length, value, year, month;
            if (!isFinite(self)) {
    Severity: Minor
    Found in source/class/fix/DateIso.js - About 1 hr to fix

      Function __startDeceleration has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          __startDeceleration: function(timeStamp) {
      
            var self = this;
      
            if (self.options.paging) {
      Severity: Minor
      Found in source/class/core/ui/Scroller.js - About 1 hr to fix

        Function createDelayed has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var createDelayed = function(nativeMethod)
          {
            return function(callback, context, delay)
            {
              if (jasy.Env.isSet("debug"))
        Severity: Minor
        Found in source/class/core/Function.js - About 1 hr to fix

          Function debounce has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              debounce : function(func, threshold, execAsap)
              {
                if (jasy.Env.isSet("debug"))
                {
                  core.Assert.isType(func, "Function");
          Severity: Minor
          Found in source/class/core/Function.js - About 1 hr to fix

            Function run has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                run : function()
                {
                  // Asynchronous test with timeout
                  var timeout = this.__timeout;
                  if (timeout != null)
            Severity: Minor
            Found in source/class/core/testrunner/Test.js - About 1 hr to fix

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

                  checkIsValid : function(obj, config, args)
                  {
                      if (args.length != 0) {
                          throw new Error("Called isValid method of property " + config.name + " on " + obj + " with too many arguments!");
                      }
              Severity: Major
              Found in source/class/core/property/Debug.js and 2 other locations - About 1 hr to fix
              source/class/core/property/Debug.js on lines 99..104
              source/class/core/property/Debug.js on lines 114..119

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

              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

                  checkResetter : function(obj, config, args)
                  {
                      if (args.length != 0) {
                          throw new Error("Called reset method of property " + config.name + " on " + obj + " with too many arguments!");
                      }
              Severity: Major
              Found in source/class/core/property/Debug.js and 2 other locations - About 1 hr to fix
              source/class/core/property/Debug.js on lines 114..119
              source/class/core/property/Debug.js on lines 129..134

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

              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 (scrollOutsideY !== 0) {
                        if (scrollOutsideY * self.__decelerationVelocityY <= 0) {
                          self.__decelerationVelocityY += scrollOutsideY * penetrationDeceleration;
                        } else {
                          self.__decelerationVelocityY = scrollOutsideY * penetrationAcceleration;
              Severity: Major
              Found in source/class/core/ui/Scroller.js and 1 other location - About 1 hr to fix
              source/class/core/ui/Scroller.js on lines 1264..1270

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

              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 (scrollOutsideX !== 0) {
                        if (scrollOutsideX * self.__decelerationVelocityX <= 0) {
                          self.__decelerationVelocityX += scrollOutsideX * penetrationDeceleration;
                        } else {
                          self.__decelerationVelocityX = scrollOutsideX * penetrationAcceleration;
              Severity: Major
              Found in source/class/core/ui/Scroller.js and 1 other location - About 1 hr to fix
              source/class/core/ui/Scroller.js on lines 1272..1278

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

              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

                  checkGetter : function(obj, config, args)
                  {
                      if (args.length != 0) {
                          throw new Error("Called get method of property " + config.name + " on " + obj + " with too many arguments!");
                      }
              Severity: Major
              Found in source/class/core/property/Debug.js and 2 other locations - About 1 hr to fix
              source/class/core/property/Debug.js on lines 99..104
              source/class/core/property/Debug.js on lines 129..134

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

              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 query has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  query : function(expression)
                  {
                    var splits = expression.split("/");
                    var current = this;
              
              
              Severity: Minor
              Found in source/class/core/presenter/Abstract.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 Queue has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  scheduling_queue = (function Queue() {
                      var first, last, item;
              
                      function Item(fn,self) {
                          this.fn = fn;
              Severity: Minor
              Found in source/class/core/event/Promise.js - About 1 hr to fix

                Function fadeIn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function addField has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          addField : function(field)
                          {
                              // possible variants
                              // 1: name, 1, test, [val1, val2]
                              // 2: name, 2, value
                  Severity: Minor
                  Found in source/class/jasy/Env.js - About 1 hr to fix

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

                                  if (any) {
                                    if (value == ",") {
                                      value = lex();
                                      if (value == "}") {
                                        // Unexpected trailing `,` in object literal.
                    Severity: Major
                    Found in source/class/core/JSON.js and 1 other location - About 1 hr to fix
                    source/class/core/JSON.js on lines 388..399

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

                    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 (any) {
                                    if (value == ",") {
                                      value = lex();
                                      if (value == "]") {
                                        // Unexpected trailing `,` in array literal.
                    Severity: Major
                    Found in source/class/core/JSON.js and 1 other location - About 1 hr to fix
                    source/class/core/JSON.js on lines 418..429

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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language