woese/guara-crm

View on GitHub
app/assets/javascripts/fcbk.js

Summary

Maintainability
F
6 days
Test Coverage

Function fcbkcomplete has 551 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.fcbkcomplete = function(opt) {
        return this.queue(function() {
            function init() {
                createFCBK();
                addInput(0)
Severity: Major
Found in app/assets/javascripts/fcbk.js - About 2 days to fix

    File fcbk.js has 555 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /** FCBKcomplete v2.8.9.3 is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> */
     (function($, undefined) {
        $.fn.fcbkcomplete = function(opt) {
            return this.queue(function() {
                function init() {
    Severity: Major
    Found in app/assets/javascripts/fcbk.js - About 1 day to fix

      Function addInput has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  function addInput(focusme) {
                      var li = $('<li class="bit-input" id="' + elemid + '_annoninput">');
                      var input = $('<input type="text" class="maininput" size="' + options.input_min_size + '" autocomplete="off">');
                      if (options.input_tabindex > 0) input.attr("tabindex", options.input_tabindex);
                      if (options.input_name != "") input.attr("name", options.input_name);
      Severity: Major
      Found in app/assets/javascripts/fcbk.js - About 3 hrs to fix

        Function elPrepare has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    function elPrepare() {
                        name = element.attr("name");
                        if (options.bricket) {
                            if (typeof(name) != 'undefined' && name.indexOf("[]") == -1) {
                                name = name + "[]"
        Severity: Minor
        Found in app/assets/javascripts/fcbk.js - About 1 hr to fix

          Function addMembers has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      function addMembers(etext, data) {
                          feed.html('');
                          if (!options.cache && data != null) {
                              cache.clear()
                          }
          Severity: Minor
          Found in app/assets/javascripts/fcbk.js - About 1 hr to fix

            Function bindEvents has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        function bindEvents() {
                            var maininput = $("#" + elemid + "_annoninput").children(".maininput");
                            bindFeedEvent();
                            feed.children("li").unbind("mousedown").mousedown(function() {
                                var option = $(this);
            Severity: Minor
            Found in app/assets/javascripts/fcbk.js - About 1 hr to fix

              Function createFCBK has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          function createFCBK() {
                              holder = $('<ul class="holder"></ul>').width(options.width);
                              if (options.attachto) {
                                  if (typeof(options.attachto) == "object") {
                                      options.attachto.append(holder)
              Severity: Minor
              Found in app/assets/javascripts/fcbk.js - About 1 hr to fix

                Function addItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            function addItem(title, value, preadded, locked, focusme) {
                                if (!maxItems()) {
                                    return false
                                }
                                var liclass = "bit-box" + (locked ? " locked": "");
                Severity: Minor
                Found in app/assets/javascripts/fcbk.js - About 1 hr to fix

                  Function load_feed has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              function load_feed(etext) {
                                  counter = 0;
                                  if (options.json_url && maxItems()) {
                                      if (options.cache && json_cache_object.get(etext)) {
                                          addMembers(etext);
                  Severity: Minor
                  Found in app/assets/javascripts/fcbk.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                            if ((_key.exclamation <= charcode && charcode <= _key.slash) || (_key.colon <= charcode && charcode <= _key.at) || (_key.squarebricket_left <= charcode && charcode <= _key.apostrof)) {
                                                string = string.replace(string[i], escape(string[i]))
                                            }
                    Severity: Major
                    Found in app/assets/javascripts/fcbk.js - About 40 mins to fix

                      Function addItem has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                                  function addItem(title, value, preadded, locked, focusme) {
                      Severity: Minor
                      Found in app/assets/javascripts/fcbk.js - About 35 mins to fix

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

                                        'set': function(id, val) {
                                            var data = element.data("jsoncache");
                                            data[id] = val;
                                            element.data("jsoncache", data)
                                        },
                        Severity: Minor
                        Found in app/assets/javascripts/fcbk.js and 1 other location - About 45 mins to fix
                        app/assets/javascripts/fcbk.js on lines 522..526

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

                        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

                                        'set': function(id, val) {
                                            var data = element.data("cache");
                                            data[id] = val;
                                            element.data("cache", data)
                                        },
                        Severity: Minor
                        Found in app/assets/javascripts/fcbk.js and 1 other location - About 45 mins to fix
                        app/assets/javascripts/fcbk.js on lines 468..472

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

                        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

                                        'get': function(id) {
                                            return element.data("cache")[id] != 'undefined' ? element.data("cache")[id] : null
                                        },
                        Severity: Minor
                        Found in app/assets/javascripts/fcbk.js and 1 other location - About 40 mins to fix
                        app/assets/javascripts/fcbk.js on lines 473..475

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

                        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

                                        'get': function(id) {
                                            return element.data("jsoncache")[id] != 'undefined' ? element.data("jsoncache")[id] : null
                                        },
                        Severity: Minor
                        Found in app/assets/javascripts/fcbk.js and 1 other location - About 40 mins to fix
                        app/assets/javascripts/fcbk.js on lines 527..529

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

                        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

                                            if (event.keyCode != _key.downarrow && event.keyCode != _key.uparrow && event.keyCode != _key.leftarrow && event.keyCode != _key.rightarrow && etext.length > options.input_min_size) {
                        Severity: Minor
                        Found in app/assets/javascripts/fcbk.js and 2 other locations - About 35 mins to fix
                        app/assets/javascripts/fcbk.js on lines 296..296
                        app/assets/javascripts/fcbk.js on lines 301..301

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

                        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

                                            if ((event.keyCode == _key.enter || event.keyCode == _key.tab || event.keyCode == _key.comma) && !checkFocusOn()) {
                        Severity: Minor
                        Found in app/assets/javascripts/fcbk.js and 2 other locations - About 35 mins to fix
                        app/assets/javascripts/fcbk.js on lines 197..197
                        app/assets/javascripts/fcbk.js on lines 296..296

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

                        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

                                            if ((event.keyCode == _key.enter || event.keyCode == _key.tab || event.keyCode == _key.comma) && checkFocusOn()) {
                        Severity: Minor
                        Found in app/assets/javascripts/fcbk.js and 2 other locations - About 35 mins to fix
                        app/assets/javascripts/fcbk.js on lines 197..197
                        app/assets/javascripts/fcbk.js on lines 301..301

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

                        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

                        There are no issues that match your filters.

                        Category
                        Status