• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

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

55.84
/plugin/common/src/main/java/com/perl5/lang/perl/psi/impl/PerlImplicitSubDefinition.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.PsiManager;
21
import com.intellij.util.IncorrectOperationException;
22
import com.intellij.util.ObjectUtils;
23
import com.perl5.PerlIcons;
24
import com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlValue;
25
import com.perl5.lang.perl.idea.codeInsight.typeInference.value.PerlValues;
26
import com.perl5.lang.perl.psi.PerlSubDefinitionElement;
27
import com.perl5.lang.perl.psi.PsiPerlSignatureContent;
28
import com.perl5.lang.perl.psi.utils.PerlSubAnnotations;
29
import com.perl5.lang.perl.psi.utils.PerlSubArgument;
30
import org.jetbrains.annotations.NotNull;
31
import org.jetbrains.annotations.Nullable;
32

33
import javax.swing.*;
34
import java.util.List;
35

36
public class PerlImplicitSubDefinition extends PerlImplicitElement implements PerlSubDefinitionElement {
37
  private final @NotNull String mySubName;
38
  private final @NotNull String myNamespaceName;
39
  private final @NotNull List<PerlSubArgument> mySubArguments;
40
  private final @NotNull PerlValue myReturnValue;
41

42
  final boolean myIsAnonymous;
43

44
  public PerlImplicitSubDefinition(@NotNull PsiManager manager,
45
                                   @NotNull String subName,
46
                                   @NotNull String namespaceName,
47
                                   @NotNull List<PerlSubArgument> argumentList,
48
                                   @Nullable PerlValue returnValue) {
49
    this(manager, subName, namespaceName, argumentList, returnValue, false);
1✔
50
  }
1✔
51

52
  public PerlImplicitSubDefinition(@NotNull PsiManager manager,
53
                                   @NotNull String subName,
54
                                   @NotNull String namespaceName,
55
                                   @NotNull List<PerlSubArgument> argumentList,
56
                                   @Nullable PerlValue returnValue,
57
                                   boolean isAnonymous) {
58
    this(manager, subName, namespaceName, argumentList, null, returnValue, isAnonymous);
1✔
59
  }
1✔
60

61
  public PerlImplicitSubDefinition(@NotNull PsiManager manager,
62
                                   @NotNull String subName,
63
                                   @NotNull String namespaceName,
64
                                   @NotNull List<PerlSubArgument> argumentList,
65
                                   @Nullable PsiElement parent,
66
                                   @Nullable PerlValue returnValue,
67
                                   boolean isAnonymous) {
68
    super(manager, parent);
1✔
69
    mySubName = subName;
1✔
70
    myNamespaceName = namespaceName;
1✔
71
    mySubArguments = argumentList;
1✔
72
    myReturnValue = ObjectUtils.notNull(returnValue, PerlValues.UNKNOWN_VALUE);
1✔
73
    myIsAnonymous = isAnonymous;
1✔
74
  }
1✔
75

76
  @Override
77
  public boolean isAnonymous() {
78
    return myIsAnonymous;
1✔
79
  }
80

81
  @Override
82
  public @NotNull PerlValue getReturnValueFromCode() {
83
    return myReturnValue;
1!
84
  }
85

86
  @Override
87
  public String toString() {
88
    return "Implicit sub: " + getPresentableName();
1✔
89
  }
90

91
  @Override
92
  public @Nullable PsiElement getNameIdentifier() {
93
    return null;
×
94
  }
95

96
  @Override
97
  public PsiElement setName(@NotNull String name) throws IncorrectOperationException {
98
    return this;
×
99
  }
100

101
  @Override
102
  public @NotNull String getExplicitNamespaceName() {
103
    return myNamespaceName;
1!
104
  }
105

106
  @Override
107
  public @NotNull String getNamespaceName() {
108
    return getExplicitNamespaceName();
1!
109
  }
110

111
  @Override
112
  public @NotNull List<PerlSubArgument> getSubArgumentsList() {
113
    return mySubArguments;
1!
114
  }
115

116
  @Override
117
  public @NotNull String getSubName() {
118
    return myIsAnonymous ? "ANON-" + mySubName : mySubName;
1!
119
  }
120

121
  @Override
122
  public String getName() {
123
    return getSubName();
1✔
124
  }
125

126
  @Override
127
  public @Nullable PerlSubAnnotations getAnnotations() {
128
    return null;
1✔
129
  }
130

131
  @Override
132
  public @Nullable Icon getIcon(int flags) {
133
    return PerlIcons.SUB_GUTTER_ICON;
1✔
134
  }
135

136
  @Override
137
  public boolean equals(Object o) {
138
    if (this == o) {
1✔
139
      return true;
1✔
140
    }
141
    if (o == null || getClass() != o.getClass()) {
1!
142
      return false;
1✔
143
    }
144
    if (!super.equals(o)) {
×
145
      return false;
×
146
    }
147

148
    PerlImplicitSubDefinition that = (PerlImplicitSubDefinition)o;
×
149

150
    if (myIsAnonymous != that.myIsAnonymous) {
×
151
      return false;
×
152
    }
153
    if (!mySubName.equals(that.mySubName)) {
×
154
      return false;
×
155
    }
156
    if (!myNamespaceName.equals(that.myNamespaceName)) {
×
157
      return false;
×
158
    }
159
    if (!mySubArguments.equals(that.mySubArguments)) {
×
160
      return false;
×
161
    }
162
    return myReturnValue.equals(that.myReturnValue);
×
163
  }
164

165
  @Override
166
  public int hashCode() {
167
    int result = super.hashCode();
1✔
168
    result = 31 * result + mySubName.hashCode();
1✔
169
    result = 31 * result + myNamespaceName.hashCode();
1✔
170
    result = 31 * result + mySubArguments.hashCode();
1✔
171
    result = 31 * result + myReturnValue.hashCode();
1✔
172
    result = 31 * result + (myIsAnonymous ? 1 : 0);
1!
173
    return result;
1✔
174
  }
175

176
  @Override
177
  public @Nullable PsiPerlSignatureContent getSignatureContent() {
178
    return null;
×
179
  }
180
}
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