Details

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

      Description

      Noncompliant Code Example

      if !filename.nil?
        if File.file?(filename) || File.directory?(filename)
          # ...
        end
      end
      
      if a then
        unless b then
          # ...
        end
      end
      

      Compliant Solution

      def isFileOrDirectory(filename)
        File.file?(filename) || File.directory?(filename)
      end
      # ...
      
      if !filename.nil? && isFileOrDirectory(filename)
        # ...
      end
      
      if a && !b then 
        # ...
      end
      

        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: