85 lines
1.5 KiB
Plaintext
85 lines
1.5 KiB
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Exceptions
|
|
|
|
The rule ignores the following cases:
|
|
|
|
* event handlers.
|
|
* overriding methods.
|
|
* all methods in classes implementing one or more interfaces.
|
|
* empty methods or methods where the body consists of a single comment or a single `throw` statement (i.e. where the intention is to simulate an abstract class).
|
|
|
|
[source,flex]
|
|
----
|
|
override function doSomething(a:int):void { // ignored
|
|
compute(a);
|
|
}
|
|
|
|
...
|
|
|
|
class AbstractSomething {
|
|
public function doSomething(a:int) { // ignored
|
|
throw new IllegalOperationError("doSomething() is abstract");
|
|
}
|
|
|
|
...
|
|
|
|
interface I {
|
|
function action(a:int, b:int);
|
|
}
|
|
|
|
class C extends I {
|
|
function action(a:int, b:int) { // ignored
|
|
return doSomethignWith(a);
|
|
}
|
|
}
|
|
|
|
function clickHandler(event:MouseEvent):void { // ignored
|
|
trace("click");
|
|
}
|
|
----
|
|
|
|
== How to fix it
|
|
|
|
include::../how-to-fix-it.adoc[]
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,flex,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
function doSomething(a:int, b:int):void // "b" is unused
|
|
{
|
|
compute(a);
|
|
}
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,flex,diff-id=1,diff-type=compliant]
|
|
----
|
|
function doSomething(a:int):void
|
|
{
|
|
compute(a);
|
|
}
|
|
----
|
|
|
|
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[]
|