Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity

      Description

      Noncompliant Code Example

      def compute(a, b)
        sum = a + b
        if  sum > 0 # Noncompliant; empty on purpose or missing piece of code?
        end
        puts "Result: #{sum}"
      end
      

      Compliant Solution

      def compute(a, b)
        sum = a + b
        if  sum > 0
          puts "Positive result"
        end
        puts "Result: #{sum}"
      end
      

      Exceptions

      When a block contains a comment, this block is not considered to be empty.
      while and unless loops are also exception to the rule.

      while @order.process_next; end # Compliant
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              christophe.zurn Christophe Zurn
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: