8
8
import com .intellij .codeInspection .ProblemHighlightType ;
9
9
import com .intellij .codeInspection .ProblemsHolder ;
10
10
import com .intellij .codeInspection .XmlSuppressableInspectionTool ;
11
- import com .intellij .openapi .vfs .VirtualFile ;
12
11
import com .intellij .psi .PsiDirectory ;
13
12
import com .intellij .psi .PsiElementVisitor ;
14
13
import com .intellij .psi .PsiFile ;
19
18
import com .magento .idea .magento2plugin .magento .packages .Package ;
20
19
import com .magento .idea .magento2plugin .util .magento .GetMagentoModuleUtil ;
21
20
import org .jetbrains .annotations .NotNull ;
22
- import java .util .*;
23
21
24
22
public class ModuleScopeInspection extends XmlSuppressableInspectionTool {
25
23
24
+ /**
25
+ * Inspection for the module config area.
26
+ */
26
27
@ NotNull
27
28
@ SuppressWarnings ({"PMD.AvoidInstantiatingObjectsInLoops" , "PMD.CognitiveComplexity" })
28
29
public PsiElementVisitor buildVisitor (
29
30
final @ NotNull ProblemsHolder problemsHolder ,
30
31
final boolean isOnTheFly
31
32
) {
32
33
return new XmlElementVisitor () {
33
- private final HashMap <String , VirtualFile > loadedFileHash = new HashMap <>();//NOPMD
34
34
private final InspectionBundle inspectionBundle = new InspectionBundle ();
35
35
private final ProblemHighlightType errorSeverity = ProblemHighlightType .WARNING ;
36
36
@@ -53,7 +53,8 @@ public void visitFile(final @NotNull PsiFile file) {
53
53
final GetMagentoModuleUtil .MagentoModuleData moduleData = GetMagentoModuleUtil
54
54
.getByContext (targetDirectory , file .getProject ());
55
55
56
- if (moduleData == null || moduleData .getType () == null || !moduleData .getType ().equals (ComponentType .module )) {
56
+ if (moduleData == null || moduleData .getType () == null
57
+ || !moduleData .getType ().equals (ComponentType .module )) {
57
58
return ;
58
59
}
59
60
0 commit comments