ianheggie/cruisecontrol.rb

View on GitHub

Showing 679 of 1,357 total issues

Method block_textile_table has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def block_textile_table( text ) 
        text.gsub!( TABLE_RE ) do |matches|

            tatts, fullrow = $~[1..2]
            tatts = pba( tatts, 'table' )
Severity: Minor
Found in lib/redcloth.rb - About 1 hr to fix

    Method e has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def e(cmd, options, &proc)
        full_cmd = full_cmd(cmd, options, &proc)
        
        options[:env].each{|k,v| ENV[k]=v}
        begin
    Severity: Minor
    Found in lib/command_line.rb - About 1 hr to fix

      Method build_without_serialization has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def build_without_serialization(revision, reasons)
          return if revision.nil? # this will only happen in the case that there are no revisions yet
      
          notify(:build_initiated)
          previous_build = last_build
      Severity: Minor
      Found in app/models/project.rb - About 1 hr to fix

        Function _generateMonthYearHeader has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                    secondary, monthNames, monthNamesShort) {

          Consider simplifying this complex logical expression.
          Open

                  if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
                      var self = this;
                      $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
                          if(self._trigger("stop", event) !== false) {
                              self._clear();

            Consider simplifying this complex logical expression.
            Open

                    if ($.datepicker._datepickerShowing)
                        switch (event.keyCode) {
                            case 9: $.datepicker._hideDatepicker();
                                    handled = false;
                                    break; // hide on tab out

              Consider simplifying this complex logical expression.
              Open

                          if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
                              (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));

                Function _generateMonthYearHeader has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                            secondary, monthNames, monthNamesShort) {

                  Consider simplifying this complex logical expression.
                  Open

                          if ($.datepicker._datepickerShowing)
                              switch (event.keyCode) {
                                  case 9: $.datepicker._hideDatepicker();
                                          handled = false;
                                          break; // hide on tab out

                    Consider simplifying this complex logical expression.
                    Open

                                if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
                                    (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));

                      Consider simplifying this complex logical expression.
                      Open

                              if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
                                  var self = this;
                                  $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
                                      if(self._trigger("stop", event) !== false) {
                                          self._clear();

                        Consider simplifying this complex logical expression.
                        Open

                                if(       this.options.tolerance == "pointer"
                                    || this.options.forcePointerForContainers
                                    || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
                                ) {
                                    return isOverElement;

                          Consider simplifying this complex logical expression.
                          Open

                                  if(       this.options.tolerance == "pointer"
                                      || this.options.forcePointerForContainers
                                      || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
                                  ) {
                                      return isOverElement;

                            Consider simplifying this complex logical expression.
                            Open

                                    if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
                                        return;
                                    }
                            Severity: Major
                            Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                              if ( jQuery.expr && jQuery.expr.filters ) {
                                  jQuery.expr.filters.hidden = function( elem ) {
                                      var width = elem.offsetWidth,
                                          height = elem.offsetHeight;
                              
                              
                              Severity: Major
                              Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                                if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
                                
                                                    event.data = handleObj.data;
                                                    event.handleObj = handleObj;
                                
                                
                                Severity: Major
                                Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                                  ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                                  !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
                                  
                                                  value = value.replace( rxhtmlTag, "<$1></$2>" );
                                  Severity: Major
                                  Found in public/javascripts/jquery-ui/development-bundle/jquery-1.7.2.js - About 1 hr to fix

                                    Method create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def create(project_name, scm, dir=CruiseControl::Configuration.projects_root)
                                          raise ArgumentError, "Project Name is required" if project_name.blank?
                                          Project.new(:name => project_name, :scm => scm).tap do |project|
                                            raise "Project named #{project.name.inspect} already exists in #{dir}" if Project.all(dir).include?(project)
                                            begin
                                    Severity: Minor
                                    Found in app/models/project.rb - About 55 mins 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

                                    Method inline_textile_span has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def inline_textile_span( text ) 
                                            QTAGS.each do |qtag_rc, ht, qtag_re, rtype|
                                                text.gsub!( qtag_re ) do |m|
                                                 
                                                    case rtype
                                    Severity: Minor
                                    Found in lib/redcloth.rb - About 55 mins 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

                                    Method scanned_chart has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      def scanned_chart
                                        clean_data
                                    
                                        CSV.foreach(@csv_file) do |row|
                                          if row[0] == "Scanned/Reported"
                                    Severity: Minor
                                    Found in lib/brakeman_charts.rb - About 55 mins 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language