Skip to content

Commit

Permalink
Modify rule s4144: Add exception for identical functions. (#1151)
Browse files Browse the repository at this point in the history
* Modify rule s4144: Add exception for identical functions.

* Update exception justification

Co-authored-by: Tibor Blenessy <tibor.blenessy@sonarsource.com>
  • Loading branch information
francoismora and saberduck committed Aug 8, 2022
1 parent 8df8965 commit 68e8d50
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion rules/S4144/javascript/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,18 @@ function getName() {

== Exceptions

Functions with fewer than 3 lines are ignored.
* Functions with fewer than 3 lines are ignored.

* This rule does not apply to function expressions and arrow functions because they don't have explicit names and are often used in a way where refactoring is not applicable.

[source,javascript]
----
list.map((item) => ({
name: item.name,
address: item.address,
country: item.country
}));
----

ifdef::env-github,rspecator-view[]

Expand Down

0 comments on commit 68e8d50

Please sign in to comment.