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

Camelcade / Perl5-IDEA / #525521581

06 Jun 2025 08:26AM UTC coverage: 82.33% (-0.02%) from 82.354%
#525521581

push

github

hurricup
Moved debugger properties to the respective bundle

18 of 26 new or added lines in 8 files covered. (69.23%)

158 existing lines in 31 files now uncovered.

30858 of 37481 relevant lines covered (82.33%)

0.82 hits per line

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

80.0
/plugin/core/src/main/java/com/perl5/lang/perl/psi/PerlVariableDeclaration.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.psi;
18

19
import com.intellij.openapi.util.NlsContexts;
20
import com.intellij.openapi.util.NlsSafe;
21
import com.intellij.openapi.util.text.StringUtil;
22
import com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlValue;
23
import com.perl5.lang.perl.psi.properties.PerlPackageMember;
24
import com.perl5.lang.perl.psi.utils.PerlVariableAnnotations;
25
import com.perl5.lang.perl.psi.utils.PerlVariableType;
26
import com.perl5.lang.perl.util.PerlPackageUtil;
27
import org.jetbrains.annotations.NotNull;
28
import org.jetbrains.annotations.Nullable;
29

30
import static com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlValues.UNKNOWN_VALUE;
31

32
public interface PerlVariableDeclaration extends PerlDeprecatable, PerlPackageMember {
33
  /**
34
   * Trying to get the package name from explicit specification or by traversing
35
   *
36
   * @return package name for current element
37
   */
38
  @NlsSafe
39
  @Override
40
  @Nullable
41
  String getNamespaceName();
42

43
  @NlsSafe
44
  String getVariableName();
45

46
  default @NotNull PerlValue getDeclaredValue() {
47
    PerlVariableAnnotations variableAnnotations = getVariableAnnotations();
1✔
48
    return variableAnnotations != null ? variableAnnotations.getAnnotatedValue() : UNKNOWN_VALUE;
1✔
49
  }
50

51
  /**
52
   * Guessing actual variable type from context
53
   *
54
   * @return variable type
55
   */
56
  PerlVariableType getActualType();
57

58
  /**
59
   * Returns stubbed, local or external variable annotations
60
   *
61
   * @return annotations or null
62
   */
63
  @Nullable
64
  PerlVariableAnnotations getVariableAnnotations();
65

66
  @Override
67
  default boolean isDeprecated() {
68
    PerlVariableAnnotations variableAnnotations = getVariableAnnotations();
1✔
69
    return variableAnnotations != null && variableAnnotations.isDeprecated();
1✔
70
  }
71

72
  /**
73
   * returns proper fqn
74
   *
75
   * @return fqn or null if name is missing
76
   */
77
  @Override
78
  default @NlsContexts.Label @Nullable String getCanonicalName() {
79
    String variableName = getVariableName();
1✔
80
    if (StringUtil.isEmpty(variableName)) {
1✔
UNCOV
81
      return null;
×
82
    }
83

84
    String packageName = getNamespaceName();
1✔
85
    if (StringUtil.isEmpty(packageName)) {
1✔
UNCOV
86
      return variableName;
×
87
    }
88
    return PerlPackageUtil.join(packageName, variableName);
1✔
89
  }
90

91
  /**
92
   * @return variable fqn with sigil
93
   */
94
  default @Nullable String getCanonicalNameWithSigil() {
95
    String canonicalName = getCanonicalName();
1✔
96
    if (canonicalName == null) {
1✔
UNCOV
97
      return null;
×
98
    }
99
    return getActualType().getSigil() + canonicalName;
1✔
100
  }
101
}
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