include::../description.adoc[]

== Noncompliant Code Example

----
if (file != null) {
  if (file.isFile || file.isDirectory) {
    /* ... */
  }
}
----

== Compliant Solution

----
if (file != null && isFileOrDirectory(file)) {
  /* ... */
}

def isFileOrDirectory(file: File): Boolean = file.isFile || file.isDirectory
----

ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)

include::../comments-and-links.adoc[]
endif::rspecator-view[]
