• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Camelcade / Perl5-IDEA / #525521551

26 May 2025 11:24AM UTC coverage: 82.32% (+0.001%) from 82.319%
#525521551

push

github

hurricup
Migrated to the presentation property

1 of 1 new or added line in 1 file covered. (100.0%)

148 existing lines in 15 files now uncovered.

30897 of 37533 relevant lines covered (82.32%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.62
/plugin/core/src/main/java/com/perl5/lang/perl/idea/inspections/PerlClashedNamespacesInspection.java
1
/*
2
 * Copyright 2015-2025 Alexandr Evstigneev
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 * http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.perl5.lang.perl.idea.inspections;
18

19
import com.intellij.codeInspection.ProblemsHolder;
20
import com.intellij.psi.PsiElement;
21
import com.intellij.psi.PsiElementVisitor;
22
import com.perl5.PerlBundle;
23
import com.perl5.lang.perl.psi.PerlNamespaceDefinitionWithIdentifier;
24
import com.perl5.lang.perl.psi.PerlVisitor;
25
import com.perl5.lang.perl.util.PerlPackageUtil;
26
import org.jetbrains.annotations.NotNull;
27

28

29
public class PerlClashedNamespacesInspection extends PerlInspection {
1✔
30
  @Override
31
  public @NotNull PsiElementVisitor buildVisitor(final @NotNull ProblemsHolder holder, boolean isOnTheFly) {
32
    return new PerlVisitor() {
1✔
33

34
      @Override
35
      public void visitPerlNamespaceDefinitionWithIdentifier(@NotNull PerlNamespaceDefinitionWithIdentifier o) {
36
        PsiElement nameIdentifier = o.getNameIdentifier();
1✔
37
        if (nameIdentifier == null) {
1✔
UNCOV
38
          return;
×
39
        }
40

41

42
        String packageName = o.getNamespaceName();
1✔
43
        if (PerlPackageUtil.MAIN_NAMESPACE_NAME.equals(packageName)) {
1✔
UNCOV
44
          return;
×
45
        }
46

47
        // fixme we should check that this is not in SDK
48
        if (PerlPackageUtil.isBuiltIn(packageName)) {
1✔
49
          registerProblem(holder, nameIdentifier,
1✔
50
                          PerlBundle.message("inspection.message.namespace.definition.clashes.with.built.in.namespace"));
1✔
51
        }
52
      }
1✔
53

54
      @Override
55
      protected boolean shouldVisitLightElements() {
56
        return true;
1✔
57
      }
58
    };
59
  }
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc