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

Camelcade / Perl5-IDEA / #525521819

12 Apr 2026 11:03AM UTC coverage: 76.189% (+0.1%) from 76.061%
#525521819

push

github

hurricup
[qodana] Suppressed a warning on the api method

14764 of 22542 branches covered (65.5%)

Branch coverage included in aggregate %.

31091 of 37644 relevant lines covered (82.59%)

0.83 hits per line

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

88.46
/plugin/common/src/main/java/com/perl5/lang/perl/psi/impl/PerlNamespaceElementImpl.java
1
/*
2
 * Copyright 2015-2026 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.psi.impl;
18

19
import com.intellij.psi.PsiElement;
20
import com.intellij.psi.PsiElementVisitor;
21
import com.intellij.psi.search.GlobalSearchScope;
22
import com.intellij.psi.tree.IElementType;
23
import com.perl5.lang.perl.psi.PerlNamespaceDefinitionElement;
24
import com.perl5.lang.perl.psi.PerlNamespaceDefinitionWithIdentifier;
25
import com.perl5.lang.perl.psi.PerlNamespaceElement;
26
import com.perl5.lang.perl.psi.PerlVisitor;
27
import com.perl5.lang.perl.util.PerlPackageService;
28
import com.perl5.lang.perl.util.PerlPackageUtilCore;
29
import org.jetbrains.annotations.NotNull;
30

31
import static com.perl5.lang.perl.parser.PerlElementTypesGenerated.TAG_PACKAGE;
32
import static com.perl5.lang.perl.util.PerlCorePackages.CORE_PACKAGES_PRAGMAS;
33

34

35
public class PerlNamespaceElementImpl extends PerlLeafPsiElementWithReferences implements PerlNamespaceElement {
36
  public PerlNamespaceElementImpl(@NotNull IElementType type, CharSequence text) {
37
    super(type, text);
1✔
38
  }
1✔
39

40
  @Override
41
  public void accept(@NotNull PsiElementVisitor visitor) {
42
    if (visitor instanceof PerlVisitor perlVisitor) {
1✔
43
      perlVisitor.visitNamespaceElement(this);
1✔
44
    }
45
    else {
46
      super.accept(visitor);
1✔
47
    }
48
  }
1✔
49

50
  @Override
51
  public @NotNull String getName() {
52
    return isTag() ? PerlPackageUtilCore.getContextNamespaceName(this) : this.getText();
1!
53
  }
54

55
  @Override
56
  public String getCanonicalName() {
57
    return PerlPackageUtilCore.getCanonicalNamespaceName(getName());
1✔
58
  }
59

60
  @Override
61
  public boolean isTag() {return getNode().getElementType() == TAG_PACKAGE;}
1✔
62

63
  @Override
64
  public boolean isPragma() {
65
    return CORE_PACKAGES_PRAGMAS.contains(getCanonicalName());
1✔
66
  }
67

68
  @Override
69
  public boolean isSUPER() {
70
    return PerlPackageUtilCore.isSUPER(getCanonicalName());
1✔
71
  }
72

73
  @Override
74
  public boolean isCORE() {
75
    return PerlPackageUtilCore.isCORE(getCanonicalName());
1✔
76
  }
77

78
  @Override
79
  public boolean isDeprecated() {
80
    PsiElement parent = getParent();
1✔
81
    if (parent instanceof PerlNamespaceDefinitionWithIdentifier) {
1!
82
      return ((PerlNamespaceDefinitionElement)parent).isDeprecated();
×
83
    }
84
    return PerlPackageService.getInstance().isDeprecated(getProject(), GlobalSearchScope.allScope(getProject()), getCanonicalName());
1✔
85
  }
86
}
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