sebastian-software/core

View on GitHub

Showing 406 of 406 total issues

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

                    for (var newPriority=modifyPriority-1; newPriority>0; newPriority--)
                    {
                        newGetter = priorityToFieldConfig[newPriority].get;
                        if (newGetter) {
                            newValue = obj[newGetter] ? obj[newGetter](propertyName) : Undefined;
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 376..388

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

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

                        for (var newPriority=modifyPriority-1; newPriority>0; newPriority--)
                        {
                            newGetter = priorityToFieldConfig[newPriority].get;
                            if (newGetter) {
                                newValue = context[newGetter] ? context[newGetter](name) : Undefined;
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 662..674

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

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

Function getFrame has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        getFrame : function(id, frame)
        {
            if (jasy.Env.isSet("debug"))
            {
                core.Assert.isType(id, "String", "Invalid asset ID (no string): " + id + "!");
Severity: Major
Found in source/class/core/io/Asset.js - About 3 hrs to fix

    File Abstract.js has 313 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    ==================================================================================================
      Core - JavaScript Foundation
      Copyright 2013-2014 Sebastian Werner
    ==================================================================================================
    Severity: Minor
    Found in source/class/core/presenter/Abstract.js - About 3 hrs to fix

      File Array.js has 312 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/Array.js - About 3 hrs to fix

        File Browser.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
        ==================================================================================================
          API Browser
          Copyright 2012 Zynga Inc.
          Copyright 2012-2014 Sebastian Werner
        Severity: Minor
        Found in source/class/core/apibrowser/Browser.js - About 3 hrs to fix

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

                prepend : function(items)
                {
                  var db = this.__items;
                  for (var i=0, l=items.length, item; i<l; i++)
                  {
          Severity: Major
          Found in source/class/core/model/Array.js and 1 other location - About 3 hrs to fix
          source/class/core/model/Array.js on lines 262..273

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

          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

                append : function(items)
                {
                  var db = this.__items;
                  for (var i=0, l=items.length, item; i<l; i++)
                  {
          Severity: Major
          Found in source/class/core/model/Array.js and 1 other location - About 3 hrs to fix
          source/class/core/model/Array.js on lines 280..291

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

          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

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

            {
              /*
              ----------------------------------------------
                HELPER
              ----------------------------------------------
          Severity: Minor
          Found in source/class/core/testrunner/Test.js - About 3 hrs to fix

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

                addChild : function(name, presenter)
                {
                  var db = this.__children;
            
                  if (jasy.Env.isSet("debug"))
            Severity: Major
            Found in source/class/core/presenter/Abstract.js and 1 other location - About 3 hrs to fix
            source/class/core/presenter/Abstract.js on lines 302..317

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

            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

                addView : function(name, view)
                {
                  var db = this.__views;
            
                  if (jasy.Env.isSet("debug"))
            Severity: Major
            Found in source/class/core/presenter/Abstract.js and 1 other location - About 3 hrs to fix
            source/class/core/presenter/Abstract.js on lines 467..482

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

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

                var binl = function(x, len)
                {
                    /* append padding */
                    x[len >> 5] |= 0x80 << ((len) % 32);
                    x[(((len + 64) >>> 9) << 4) + 14] = len;
            Severity: Major
            Found in source/class/core/crypt/MD5.js - About 3 hrs to fix

              Function testFinished has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  testFinished : function(test)
                  {
                    console.info("- " + test.getSummary());
              
                    if (!test.wasSuccessful())
              Severity: Minor
              Found in source/class/core/testrunner/reporter/Console.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

              Function moveObject has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      moveObject : function(obj, newParent, oldParent)
                      {
                          // Fast compare (e.g. both null - should not happen, but still)
                          if (newParent == oldParent) {
                              return;
              Severity: Major
              Found in source/class/core/property/Multi.js - About 3 hrs to fix

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

                        if (jasy.Env.isSet("debug"))
                        {
                          core.Assert.isType(type, "String", "Invalid event type - non string!");
                          core.Assert.isNotEmpty(type, "Invalid event type - empty string!");
                          core.Assert.isType(callback, "Function", "Invalid event callback!");
                Severity: Major
                Found in source/class/core/event/MEventTarget.js and 1 other location - About 3 hrs to fix
                source/class/core/event/MEventTarget.js on lines 135..144

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

                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(type, "String", "Invalid event type!");
                          core.Assert.isNotEmpty(type, "Invalid event type!");
                          core.Assert.isType(callback, "Function", "Invalid event callback!");
                Severity: Major
                Found in source/class/core/event/MEventTarget.js and 1 other location - About 3 hrs to fix
                source/class/core/event/MEventTarget.js on lines 64..73

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

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

                /*
                ==================================================================================================
                  Core - JavaScript Foundation
                  Copyright 2013-2014 Sebastian Fastner
                ==================================================================================================
                Severity: Minor
                Found in source/class/core/event/Promise.js - About 3 hrs to fix

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

                        if (!self.options.scrollingY) {
                  
                          top = self.__scrollTop;
                  
                        } else {
                  Severity: Major
                  Found in source/class/core/ui/Scroller.js and 1 other location - About 3 hrs to fix
                  source/class/core/ui/Scroller.js on lines 504..516

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

                  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 (!self.options.scrollingX) {
                  
                          left = self.__scrollLeft;
                  
                        } else {
                  Severity: Major
                  Found in source/class/core/ui/Scroller.js and 1 other location - About 3 hrs to fix
                  source/class/core/ui/Scroller.js on lines 518..530

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

                  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