rspec/rules/S1467/flex/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

42 lines
917 B
Plaintext

== Why is this an issue?
A listener can be attached to an object only after it has been constructed. So dispatching an event in a constructor is useless and error prone.
=== Noncompliant code example
[source,flex]
----
public class MyClass
{
public function MyClass()
{
dispatchEvent( new Event( "uselessEvent" ) );
}
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Remove this event dispatch from the "XXXX" constructor
'''
== Comments And Links
(visible only on this page)
=== on 22 Nov 2013, 12:28:48 Freddy Mallet wrote:
Is implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3279
=== on 24 Nov 2013, 19:04:22 Ann Campbell wrote:
I'm tempted to add a Compliant Solution using [PostConstruct], but I'm afraid my 3-minute skim of Flex sites doesn't adequately qualify me...
endif::env-github,rspecator-view[]