rspec/rules/S1186/apex/rule.adoc

57 lines
997 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
:operationName: method
2020-06-30 12:47:33 +02:00
include::../description.adoc[]
== How to fix it
=== Code examples
==== Noncompliant code example
2020-06-30 12:47:33 +02:00
[source,apex,diff-id=1,diff-type=noncompliant]
2020-06-30 12:47:33 +02:00
----
public void shouldNotBeEmpty() { // Noncompliant - method is empty
}
public void notImplemented() { // Noncompliant - method is empty
}
public void emptyOnPurpose() { // Noncompliant - method is empty
2020-06-30 12:47:33 +02:00
}
----
==== Compliant solution
2020-06-30 12:47:33 +02:00
[source,apex,diff-id=1,diff-type=compliant]
2020-06-30 12:47:33 +02:00
----
public void shouldNotBeEmpty() {
doSomething();
}
public void notImplemented() {
throw new Exception('notImplemented() cannot be performed because...');
}
public void emptyOnPurpose() {
// comment explaining why the method is empty
2020-06-30 12:47:33 +02:00
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]