LivePersonInc/chronosjs

View on GitHub

Showing 71 of 71 total issues

Function prototype has 434 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    PostMessageChannel.prototype = (function () {
        /**
         * Method for initialization
         * @param {Object} options the configuration options for the instance
         * @param {Object} options.target - the target iframe or iframe configuration
Severity: Major
Found in src/courier/PostMessageChannel.js - About 2 days to fix

    Function prototype has 328 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            PostMessageCourier.prototype = (function () {
                /**
                 * Method for initialization
                 * @param {Object} options - the configuration options for the instance
                 * @param {Object} options.target - the target iframe or iframe configuration
    Severity: Major
    Found in src/courier/PostMessageCourier.js - About 1 day to fix

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

      ;(function (root, factory) {
          "use strict";
      
          /* istanbul ignore if  */
          //<amd>
      Severity: Major
      Found in src/Commands.js and 1 other location - About 7 hrs to fix
      src/Reqres.js on lines 1..194

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

      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

      ;(function (root, factory) {
          "use strict";
      
          /* istanbul ignore if  */
          //<amd>
      Severity: Major
      Found in src/Reqres.js and 1 other location - About 7 hrs to fix
      src/Commands.js on lines 1..194

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

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

      ;(function (root, chronosRoot, factory) {
          "use strict";
      
          /* istanbul ignore if  */
          //<amd>
      Severity: Minor
      Found in src/courier/PostMessageChannel.js - About 7 hrs to fix

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

        ;(function (root, factory) {
            "use strict";
        
            /* istanbul ignore if  */
            //<amd>
        Severity: Major
        Found in src/Events.js and 1 other location - About 6 hrs to fix
        src/util/CommandsUtil.js on lines 1..81

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

        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

        ;(function (root, factory) {
            "use strict";
        
            /* istanbul ignore if */
            //<amd>
        Severity: Major
        Found in src/util/CommandsUtil.js and 1 other location - About 6 hrs to fix
        src/Events.js on lines 1..264

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

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

            function Events(defaults) {
                var appName = "Events",
                    attrName = "eventName",
                    eventId = 0,
                    lstnrs = {},
        Severity: Major
        Found in src/Events.js - About 6 hrs to fix

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

                              try {
                                  if ("function" === typeof cb) {
                                      callBack.func.call(callBack.context, cmdData, cb);
                                  } else {
                                      callBack.func.call(callBack.context, cmdData);
          Severity: Major
          Found in src/Commands.js and 1 other location - About 5 hrs to fix
          src/Reqres.js on lines 141..159

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

          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

                              try {
                                  if ("function" === typeof cb) {
                                      ret = callBack.func.call(callBack.context, reqData, cb);
                                  } else {
                                      ret = callBack.func.call(callBack.context, reqData);
          Severity: Major
          Found in src/Reqres.js and 1 other location - About 5 hrs to fix
          src/Commands.js on lines 142..160

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

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

          /**
           * LIMITATIONS:
           * 1) Only supports browsers which implements postMessage API and have native JSON implementation (IE8+, Chrome, FF, Safari, Opera, IOS, Opera Mini, Android)
           * 2) IE9-, FF & Opera Mini does not support MessageChannel and therefore we fallback to using basic postMessage.
           *    This makes the communication opened to any handler registered for messages on the same origin.
          Severity: Minor
          Found in src/courier/PostMessageCourier.js - About 5 hrs to fix

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

            ;(function (root, chronosRoot, factory) {
                "use strict";
            
                /* istanbul ignore if  */
                //<amd>
            Severity: Major
            Found in src/courier/PostMessageChannelPolyfill.js and 1 other location - About 4 hrs to fix
            src/courier/PostMessageMapper.js on lines 1..23

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

            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

            ;(function (root, factory) {
                "use strict";
            
                /* istanbul ignore if  */
                //<amd>
            Severity: Major
            Found in src/courier/PostMessageMapper.js and 1 other location - About 4 hrs to fix
            src/courier/PostMessageChannelPolyfill.js on lines 1..23

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

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

                function ReqRes(defaults) {
                    var appName = "ReqRes",
                        attrName = "reqName",
                        requestId = 0,
                        requests = {},
            Severity: Major
            Found in src/Reqres.js - About 3 hrs to fix

              Function Commands has 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function Commands(defaults) {
                      var appName = "Commands",
                          attrName = "cmdName",
                          commandId = 0,
                          commands = {},
              Severity: Major
              Found in src/Commands.js - About 3 hrs to fix

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

                                    result.then(function (data) {
                                        params = [id, ACTION_TYPE.RETURN, null];
                
                                        if (ACTION_TYPE.REQUEST === name) {
                                            params.push(data);
                Severity: Major
                Found in src/courier/PostMessageCourier.js and 1 other location - About 3 hrs to fix
                src/courier/PostMessageCourier.js on lines 688..700

                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

                                    else if ("undefined" !== typeof result) {
                                        params = [id, ACTION_TYPE.RETURN, null];
                
                                        if (ACTION_TYPE.REQUEST === name) {
                                            params.push(result);
                Severity: Major
                Found in src/courier/PostMessageCourier.js and 1 other location - About 3 hrs to fix
                src/courier/PostMessageCourier.js on lines 656..668

                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

                Function prototype has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    PostMessagePromise.prototype = (function () {
                        /**
                         * Method for initialization
                         * @param {Function} [executor] - optional method to be invoked during initialization that will have
                         *                   arguments of resolve and reject according to ES6 Promise A+ spec
                Severity: Major
                Found in src/courier/PostMessagePromise.js - About 2 hrs to fix

                  Function prototype has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      PostMessageChannelPolyfill.prototype = (function () {
                          /**
                           * Method for initialization
                           * @param {Object} target - The DOM node of the target iframe or window
                           * @param {Object} [options] the configuration options for the instance
                  Severity: Major
                  Found in src/courier/PostMessageChannelPolyfill.js - About 2 hrs to fix

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

                            function comply(cmd) {
                                if ("*" !== defaultAppName) {
                                    cmd.appName = cmd.appName || defaultAppName;
                                }
                                return cmdUtil.bind({
                    Severity: Major
                    Found in src/Commands.js and 1 other location - About 2 hrs to fix
                    src/Reqres.js on lines 57..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 85.

                    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