rspec/rules/S1454/flex/rule.adoc

48 lines
1.0 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
Using several "--" or "{plus}{plus}" unary operators in the same arithmetic expression can quickly make the expression unreadable.
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,flex]
2021-04-28 16:49:39 +02:00
----
var j:int = foo++ - --bar;
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,flex]
2021-04-28 16:49:39 +02:00
----
bar--;
var j:int = foo++ - bar;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Split this expression into multiple expressions so that each one contains no more than a single "{plus}{plus}" or "--" unary operator
'''
== Comments And Links
(visible only on this page)
=== on 22 Nov 2013, 13:51:46 Freddy Mallet wrote:
Is implemented by \https://jira.codehaus.org/browse/SONARPLUGINS-3284 for Flex
=== on 10 Dec 2013, 11:53:06 Freddy Mallet wrote:
Is implemented by \http://jira.codehaus.org/browse/SONARJAVA-393 for Java
=== on 11 Dec 2013, 14:45:46 Freddy Mallet wrote:
I'm closing this spec as RSPEC-881 is definitely better.
endif::env-github,rspecator-view[]