
## Review A dedicated reviewer checked the rule description successfully for: - [ ] logical errors and incorrect information - [ ] information gaps and missing content - [ ] text style and tone - [ ] PR summary and labels follow [the guidelines](https://github.com/SonarSource/rspec/#to-modify-an-existing-rule)
56 lines
1.0 KiB
Plaintext
56 lines
1.0 KiB
Plaintext
:language: javascript
|
|
|
|
include::../rule.adoc[]
|
|
|
|
=== Exceptions
|
|
|
|
The rule ignores TypeScript parameter properties when counting parameters:
|
|
|
|
[source,javascript]
|
|
----
|
|
class C {
|
|
constructor(
|
|
private param1: number, // ignored
|
|
param2: boolean, // counted
|
|
public param3: string, // ignored
|
|
readonly param4: string[], // ignored
|
|
param5: number | string // counted
|
|
) {} // Compliant by exception
|
|
}
|
|
----
|
|
|
|
The rule also ignores Angular component constructors:
|
|
|
|
[source,javascript]
|
|
----
|
|
import { Component } from '@angular/core';
|
|
|
|
@Component({/* ... */})
|
|
class Component {
|
|
constructor(p1, p2, p3, p4, p5) {} // Compliant by exception
|
|
}
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
* Key: max
|
|
** Description: Maximum authorized number of parameters
|
|
** Default Value: 7
|
|
|
|
|
|
include::../parameters.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|