rspec/rules/S3030/java/rule.adoc

23 lines
713 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Importing a class statically allows you to use its ``++public static++`` members without qualifying them with the class name. That can be handy, but if you import too many classes statically, your code can become confusing and difficult to maintain.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
With the default threshold value: 4
----
import static java.lang.Math.*;
import static java.util.Collections.*;
import static com.myco.corporate.Constants.*;
import static com.myco.division.Constants.*;
import static com.myco.department.Constants.*; // Noncompliant
----
ifdef::env-github,rspecator-view[]
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]