woese/guara-crm

View on GitHub

Showing 101 of 101 total issues

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

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

                if(dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
                    this._defaults.hourMin = minDateTime.getHours();
                    if (this.hour <= this._defaults.hourMin) {
                        this.hour = this._defaults.hourMin;
                        this._defaults.minuteMin = minDateTime.getMinutes();
    Severity: Major
    Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 2 days to fix
    app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 727..752

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

    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(dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()){
                    this._defaults.hourMax = maxDateTime.getHours();
                    if (this.hour >= this._defaults.hourMax) {
                        this.hour = this._defaults.hourMax;
                        this._defaults.minuteMax = maxDateTime.getMinutes();
    Severity: Major
    Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 2 days to fix
    app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 687..713

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

    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 jquery-ui-timepicker-addon.js has 1028 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    * jQuery timepicker addon
    * By: Trent Richardson [http://trentrichardson.com]
    * Version 0.9.9
    * Last Modified: 02/05/2012
    Severity: Major
    Found in app/assets/javascripts/jquery-ui-timepicker-addon.js - About 2 days to fix

      Function _injectTimePicker has 268 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _injectTimePicker: function() {
              var $dp = this.inst.dpDiv,
                  o = this._defaults,
                  tp_inst = this,
                  // Added by Peter Medeiros:
      Severity: Major
      Found in app/assets/javascripts/jquery-ui-timepicker-addon.js - About 1 day 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

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

                      if (o.showMillisec && o.millisecGrid > 0) {
                          $tp.find(".ui_tpicker_millisec table").css({
                              width: size + "%",
                              marginLeft: (size / (-2 * millisecGridSize)) + "%",
                              borderCollapse: 'collapse'
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 1 day to fix
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 579..596

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

          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 (o.showSecond && o.secondGrid > 0) {
                          $tp.find(".ui_tpicker_second table").css({
                              width: size + "%",
                              marginLeft: (size / (-2 * secondGridSize)) + "%",
                              borderCollapse: 'collapse'
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 1 day to fix
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 598..615

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

          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

          Method format has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

                def format(str, section)
                  @prefix = ''
                  @suffix = ''
          
                  mods = section[:modifiers]
          Severity: Minor
          Found in lib/active_migration/converters/rtf_to_html.rb - About 4 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

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

                      this.millisec_slider = $tp.find('#ui_tpicker_millisec_'+ dp_id).slider({
                          orientation: "horizontal",
                          value: this.millisec,
                          min: o.millisecMin,
                          max: millisecMax,
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 490..500

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

          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

                      this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({
                          orientation: "horizontal",
                          value: this.second,
                          min: o.secondMin,
                          max: secMax,
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 502..512

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

          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 (o.showMillisec && o.millisecGrid > 0) {
                          html += '<div style="padding-left: 1px"><table><tr>';
          
                          for (var l = o.millisecMin; l <= millisecMax; l += parseInt(o.millisecGrid,10)) {
                              millisecGridSize++;
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 397..406
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 415..424

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

          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 (o.showMinute && o.minuteGrid > 0) {
                          html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
          
                          for (var m = o.minuteMin; m <= minMax; m += parseInt(o.minuteGrid,10)) {
                              minuteGridSize++;
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 415..424
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 433..442

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

          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 (o.showSecond && o.secondGrid > 0) {
                          html += '<div style="padding-left: 1px"><table><tr>';
          
                          for (var s = o.secondMin; s <= secMax; s += parseInt(o.secondGrid,10)) {
                              secondGridSize++;
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js and 2 other locations - About 3 hrs to fix
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 397..406
          app/assets/javascripts/jquery-ui-timepicker-addon.js on lines 433..442

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

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

              _limitMinMaxDateTime: function(dp_inst, adjustSliders){
                  var o = this._defaults,
                      dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
          
                  if(!this._defaults.showTimepicker) return; // No time so nothing to check here
          Severity: Major
          Found in app/assets/javascripts/jquery-ui-timepicker-addon.js - About 3 hrs 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 _newInst has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _newInst: function($input, o) {
                      var tp_inst = new Timepicker(),
                          inlineSettings = {};
                          
                      for (var attrName in this._defaults) {
              Severity: Major
              Found in app/assets/javascripts/jquery-ui-timepicker-addon.js - About 2 hrs to fix

                Method xls_migrate has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                    def xls_migrate
                      begin
                        @xls = Spreadsheet.open @schema_from[:url]
                        # TODO: make others workbook accessible by configuration
                        sheet = @xls.worksheet 0
                Severity: Minor
                Found in lib/active_migration/migration.rb - About 2 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 _parseTime has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _parseTime: function(timeString, withDate) {
                        var regstr = this._defaults.timeFormat.toString()
                                .replace(/h{1,2}/ig, '(\\d?\\d)')
                                .replace(/m{1,2}/ig, '(\\d?\\d)')
                                .replace(/s{1,2}/ig, '(\\d?\\d)')
                Severity: Major
                Found in app/assets/javascripts/jquery-ui-timepicker-addon.js - About 2 hrs to fix

                  Function Timepicker has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Timepicker() {
                      this.regional = []; // Available regional settings, indexed by language code
                      this.regional[''] = { // Default regional settings
                          currentText: 'Now',
                          closeText: 'Done',
                  Severity: Major
                  Found in app/assets/javascripts/jquery-ui-timepicker-addon.js - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language