sebastian-software/core

View on GitHub

Showing 406 of 406 total issues

Function detect has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  detect : function(data)
  {
    return new core.event.Promise(function(resolve, reject) {
      var url = "//maps.googleapis.com/maps/api/geocode/json?sensor=true&latlng=";
      url += data.latitude + "," + data.longitude;
Severity: Minor
Found in source/class/core/service/location/GeoCode.js - About 1 hr to fix

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

        function binb(m, l)
        {
            var HASH = [1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225];
            var W = new Array(64);
            var a, b, c, d, e, f, g, h;
    Severity: Minor
    Found in source/class/core/crypt/SHA256.js - About 1 hr to fix

      Function construct has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

        construct : function(nativeEvent, eventType)
        {
          // We use the touchpoint for touch events
          var isMouse = nativeEvent.type != null ? true : false;
      
      
      Severity: Minor
      Found in source/class/core/bom/event/type/Pointer.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

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

          decrementActivity : function(hint)
          {
            if (--this.__activityCounter == 0) {
              this.getView("root").hideActivityIndicator();
            }
      Severity: Major
      Found in source/class/core/application/SinglePage.js and 1 other location - About 1 hr to fix
      source/class/core/application/SinglePage.js on lines 50..61

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

      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

          incrementActivity : function(hint)
          {
            if (++this.__activityCounter == 1) {
              this.getView("root").showActivityIndicator();
            }
      Severity: Major
      Found in source/class/core/application/SinglePage.js and 1 other location - About 1 hr to fix
      source/class/core/application/SinglePage.js on lines 67..78

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 70.

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

              isTypeOf : function(value, type)
              {
                  var result = false;
      
                  if (value == null)
      Severity: Minor
      Found in source/class/core/Main.js - About 1 hr to fix

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

                    for (var j=0, jl=db.length; j<jl; j++)
                    {
                      var entry = db[j];
                      if (entry.type == "move") {
                        entry.callback(eventObject);
        Severity: Major
        Found in source/class/core/bom/PointerEvent.js and 3 other locations - About 1 hr to fix
        source/class/core/bom/PointerEvent.js on lines 153..159
        source/class/core/bom/PointerEvent.js on lines 218..224
        source/class/core/bom/PointerEvent.js on lines 251..257

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

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

                    for (var j=0, jl=db.length; j<jl; j++)
                    {
                      var entry = db[j];
                      if (entry.type == "up") {
                        entry.callback(eventObject);
        Severity: Major
        Found in source/class/core/bom/PointerEvent.js and 3 other locations - About 1 hr to fix
        source/class/core/bom/PointerEvent.js on lines 153..159
        source/class/core/bom/PointerEvent.js on lines 189..195
        source/class/core/bom/PointerEvent.js on lines 251..257

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

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

                    for (var j=0, jl=db.length; j<jl; j++)
                    {
                      var entry = db[j];
                      if (entry.type == "down") {
                        entry.callback(eventObject);
        Severity: Major
        Found in source/class/core/bom/PointerEvent.js and 3 other locations - About 1 hr to fix
        source/class/core/bom/PointerEvent.js on lines 189..195
        source/class/core/bom/PointerEvent.js on lines 218..224
        source/class/core/bom/PointerEvent.js on lines 251..257

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

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

                    for (var j=0, jl=db.length; j<jl; j++)
                    {
                      var entry = db[j];
                      if (entry.type == "cancel") {
                        entry.callback(eventObject);
        Severity: Major
        Found in source/class/core/bom/PointerEvent.js and 3 other locations - About 1 hr to fix
        source/class/core/bom/PointerEvent.js on lines 153..159
        source/class/core/bom/PointerEvent.js on lines 189..195
        source/class/core/bom/PointerEvent.js on lines 218..224

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

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

            isInstance : function(a, b, message)
            {
              try{
                core.Assert.isInstance(a, b);
              } catch(ex) {
        Severity: Major
        Found in source/class/core/testrunner/Test.js and 4 other locations - About 1 hr to fix
        source/class/core/testrunner/Test.js on lines 128..137
        source/class/core/testrunner/Test.js on lines 145..154
        source/class/core/testrunner/Test.js on lines 162..171
        source/class/core/testrunner/Test.js on lines 247..256

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

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

            isIdentical : function(a, b, message)
            {
              try{
                core.Assert.isIdentical(a, b);
              } catch(ex) {
        Severity: Major
        Found in source/class/core/testrunner/Test.js and 4 other locations - About 1 hr to fix
        source/class/core/testrunner/Test.js on lines 128..137
        source/class/core/testrunner/Test.js on lines 162..171
        source/class/core/testrunner/Test.js on lines 230..239
        source/class/core/testrunner/Test.js on lines 247..256

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

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

            isNotEqual : function(a, b, message)
            {
              try{
                core.Assert.isNotEqual(a, b);
              } catch(ex) {
        Severity: Major
        Found in source/class/core/testrunner/Test.js and 4 other locations - About 1 hr to fix
        source/class/core/testrunner/Test.js on lines 145..154
        source/class/core/testrunner/Test.js on lines 162..171
        source/class/core/testrunner/Test.js on lines 230..239
        source/class/core/testrunner/Test.js on lines 247..256

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

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

            isType : function(a, b, message)
            {
              try{
                core.Assert.isType(a, b);
              } catch(ex) {
        Severity: Major
        Found in source/class/core/testrunner/Test.js and 4 other locations - About 1 hr to fix
        source/class/core/testrunner/Test.js on lines 128..137
        source/class/core/testrunner/Test.js on lines 145..154
        source/class/core/testrunner/Test.js on lines 162..171
        source/class/core/testrunner/Test.js on lines 230..239

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

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

            isNotIdentical : function(a, b, message)
            {
              try{
                core.Assert.isNotIdentical(a, b);
              } catch(ex) {
        Severity: Major
        Found in source/class/core/testrunner/Test.js and 4 other locations - About 1 hr to fix
        source/class/core/testrunner/Test.js on lines 128..137
        source/class/core/testrunner/Test.js on lines 145..154
        source/class/core/testrunner/Test.js on lines 230..239
        source/class/core/testrunner/Test.js on lines 247..256

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

        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

            easeInOutQuint: function(pos) {
                if ((pos /= 0.5) < 1) {
                    return 0.5 * Math.pow(pos, 5);
                }
        
        
        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 63..69

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

        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

            easeInOutCubic: function(pos) {
                if ((pos /= 0.5) < 1) {
                    return 0.5 * Math.pow(pos, 3);
                }
        
        
        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 113..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 68.

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

            any : function(promisesOrValues)
            {
              if (jasy.Env.isSet("debug")) {
                core.Assert.isType(promisesOrValues, "ArrayOrPromise");
              }
        Severity: Minor
        Found in source/class/core/event/Flow.js - About 1 hr to fix

          Function doTouchStart has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              doTouchStart: function(touches, timeStamp) {
          
                // Array-like check is enough here
                if (touches.length == null) {
                  throw new Error("Invalid touch list: " + touches);
          Severity: Minor
          Found in source/class/core/ui/Scroller.js - About 1 hr to fix

            Function getter has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        var getter = function()
                        {
                            var context = this;
            
                            if (jasy.Env.isSet("debug")) {
            Severity: Minor
            Found in source/class/core/property/Multi.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language