Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
249,300
void (@Nullable RefEntity refEntity, CommonProblemDescriptor @NotNull ... commonProblemDescriptors) { if (!(refEntity instanceof RefElement)) return; PsiElement element = ((RefElement)refEntity).getPsiElement(); convertToProblemDescriptors(element, commonProblemDescriptors, result); }
addProblemElement
249,301
RefEntity (@NotNull CommonProblemDescriptor descriptor) { throw new RuntimeException(); }
getElement
249,302
void (@NotNull RefEntity elem) { CommonProblemDescriptor[] elemDescriptors = globalTool.checkElement(elem, scope, inspectionManager, inspectionContext); if (elemDescriptors != null) { convertToProblemDescriptors(psiFile, elemDescriptors, result); } for (RefEntity child : elem.getChildren()) { child.accept(this); } }
visitElement
249,303
void (@NotNull PsiElement element, CommonProblemDescriptor @NotNull [] commonProblemDescriptors, @NotNull List<? super ProblemDescriptor> outDescriptors) { for (CommonProblemDescriptor common : commonProblemDescriptors) { if (common instanceof ProblemDescriptor) { outDescriptors.add((ProblemDescriptor)common); } else {...
convertToProblemDescriptors
249,304
List<LocalInspectionToolWrapper> (@NotNull Collection<? extends LocalInspectionToolWrapper> tools, @NotNull Set<String> elementDialectIds) { Map<String, Boolean> resultsWithDialects = new HashMap<>(); Map<String, Boolean> resultsNoDialects = new HashMap<>(); return ContainerUtil.filter(tools, tool -> { String toolLangu...
filterToolsApplicableByLanguage
249,305
Set<String> (@NotNull List<? extends PsiElement> inside, @NotNull List<? extends PsiElement> outside) { Set<String> dialectIds = new HashSet<>(); Set<Language> processedLanguages = new HashSet<>(); addDialects(inside, processedLanguages, dialectIds); addDialects(outside, processedLanguages, dialectIds); return dialectI...
calcElementDialectIds
249,306
Set<String> (@NotNull List<? extends PsiElement> elements) { Set<String> dialectIds = new HashSet<>(); Set<Language> processedLanguages = new HashSet<>(); addDialects(elements, processedLanguages, dialectIds); return dialectIds; }
calcElementDialectIds
249,307
void (@NotNull List<? extends PsiElement> elements, @NotNull Set<? super Language> outProcessedLanguages, @NotNull Set<? super String> outDialectIds) { for (PsiElement element : elements) { Language language = element.getLanguage(); outDialectIds.add(language.getID()); addDialects(language, outProcessedLanguages, outDi...
addDialects
249,308
void (@NotNull Language language, @NotNull Set<? super Language> outProcessedLanguages, @NotNull Set<? super String> outDialectIds) { if (outProcessedLanguages.add(language)) { Collection<Language> dialects = language.getTransitiveDialects(); outProcessedLanguages.addAll(dialects); for (Language dialect : dialects) { o...
addDialects
249,309
RefManager () { return getContext().getRefManager(); }
getRefManager
249,310
void (@NotNull Consumer<? super Element> resultConsumer, @NotNull Predicate<? super RefEntity> excludedEntities, @NotNull Predicate<? super CommonProblemDescriptor> excludedDescriptors) { getRefManager().iterate(new RefVisitor() { @Override public void visitElement(@NotNull RefEntity elem) { if (!excludedEntities.test(...
exportResults
249,311
void (@NotNull RefEntity elem) { if (!excludedEntities.test(elem)) { exportResults(resultConsumer, elem, excludedDescriptors); } }
visitElement
249,312
Project () { return myContext.getProject(); }
getProject
249,313
void (@NotNull Consumer<? super Element> resultConsumer, @NotNull RefEntity refEntity, @NotNull Predicate<? super CommonProblemDescriptor> isDescriptorExcluded) { CommonProblemDescriptor[] descriptions = getProblemElements().get(refEntity); if (descriptions != null) { exportResults(descriptions, refEntity, resultConsum...
exportResults
249,314
void (CommonProblemDescriptor @NotNull [] descriptors, @NotNull RefEntity refEntity, @NotNull BiConsumer<? super Element, ? super CommonProblemDescriptor> problemSink, @NotNull Predicate<? super CommonProblemDescriptor> isDescriptorExcluded) { final List<ProblemDescriptorKey> keys = Arrays .stream(descriptors) .filter(...
exportResults
249,315
void (CommonProblemDescriptor @NotNull [] descriptors, @NotNull RefEntity refEntity, @NotNull Consumer<? super Element> problemSink, @NotNull Predicate<? super CommonProblemDescriptor> isDescriptorExcluded) { exportResults(descriptors, refEntity, (element, problem) -> problemSink.accept(element) , isDescriptorExcluded)...
exportResults
249,316
void (@NotNull RefEntity refEntity, @NotNull CommonProblemDescriptor descriptor, @NotNull Element element) { PsiElement psiElement = descriptor instanceof ProblemDescriptor ? ((ProblemDescriptor)descriptor).getPsiElement() : null; try { @NonNls Element problemClassElement = new Element(INSPECTION_RESULTS_PROBLEM_CLASS_...
exportResult
249,317
String () { return getToolWrapper().getShortName(); }
getSeverityDelegateName
249,318
GlobalInspectionContextEx () { return myContext; }
getContext
249,319
ArrayFactory<CommonProblemDescriptor> () { return CommonProblemDescriptor.ARRAY_FACTORY; }
arrayFactory
249,320
boolean (@NotNull CommonProblemDescriptor descriptor) { return myExcludedElements.containsValue(descriptor); }
isExcluded
249,321
boolean (@NotNull RefEntity entity) { CommonProblemDescriptor[] excluded = myExcludedElements.get(entity); CommonProblemDescriptor[] problems = myProblemElements.get(entity); return excluded != null && problems != null && Comparing.equal(ContainerUtil.newHashSet(excluded), ContainerUtil.newHashSet(problems)); }
isExcluded
249,322
void (@NotNull RefEntity element) { myExcludedElements.remove(element); }
amnesty
249,323
void (@NotNull RefEntity element) { myExcludedElements.put(element, myProblemElements.getOrDefault(element, CommonProblemDescriptor.EMPTY_ARRAY)); }
exclude
249,324
void (@NotNull CommonProblemDescriptor descriptor) { myExcludedElements.removeValue(descriptor); }
amnesty
249,325
void (@NotNull CommonProblemDescriptor descriptor) { RefEntity entity = ObjectUtils.chooseNotNull(myProblemElements.getKeyFor(descriptor), myResolvedElements.getKeyFor(descriptor)); if (entity != null) { myExcludedElements.put(entity, descriptor); } }
exclude
249,326
void (@NotNull CommonProblemDescriptor descriptor) { RefEntity removed = myProblemElements.removeValue(descriptor); if (removed != null) { mySuppressedElements.put(removed, descriptor); } }
suppressProblem
249,327
void (@NotNull RefEntity entity) { CommonProblemDescriptor[] removed = myProblemElements.remove(entity); if (removed != null) { mySuppressedElements.put(entity, removed); } }
suppressProblem
249,328
void () { Set<RefEntity> elements; if (filterResolvedItems()) { // only non-excluded actual problems elements = getProblemElements().keys().stream().filter(entity -> !isExcluded(entity)).collect(Collectors.toSet()); } else { // add actual problems elements = new HashSet<>(getProblemElements().keys()); // add quick-fixe...
updateProblemElements
249,329
boolean () { return false; }
filterResolvedItems
249,330
void (@Nullable RefEntity refElement, CommonProblemDescriptor @NotNull ... descriptions) { addProblemElement(refElement, true, descriptions); }
addProblemElement
249,331
void (@Nullable RefEntity refElement, boolean filterSuppressed, CommonProblemDescriptor @NotNull ... descriptors) { if (refElement == null || descriptors.length == 0) { return; } ReportedProblemFilter filter = myContext.getReportedProblemFilter(); if (filter != null && !filter.shouldReportProblem(refElement, descriptor...
addProblemElement
249,332
void (@NotNull RefEntity refElement, CommonProblemDescriptor @NotNull [] descriptors) { try { writeOutput(descriptors, refElement); } catch (IOException e) { LOG.error(e); } }
addLocalInspectionProblem
249,333
void (RefEntity element, CommonProblemDescriptor[] descriptors) { if (!(element instanceof RefElement)) return; SmartPsiElementPointer<?> pointer = ((RefElement)element).getPointer(); if (pointer == null) return; VirtualFile entityFile = ensureNotInjectedFile(pointer.getVirtualFile()); if (entityFile == null) return; f...
checkFromSameFile
249,334
RefEntity (@NotNull CommonProblemDescriptor descriptor) { return myProblemElements.getKeyFor(descriptor); }
getElement
249,335
VirtualFile (VirtualFile file) { return file instanceof VirtualFileWindow ? ((VirtualFileWindow)file).getDelegate() : file; }
ensureNotInjectedFile
249,336
Collection<CommonProblemDescriptor> () { return myProblemElements.getValues(); }
getProblemDescriptors
249,337
void (@NotNull CommonProblemDescriptor descriptor) { RefEntity entity = myProblemElements.removeValue(descriptor); if (entity != null) { myResolvedElements.put(entity, descriptor); } }
resolveProblem
249,338
boolean (@Nullable CommonProblemDescriptor descriptor) { return myResolvedElements.containsValue(descriptor); }
isProblemResolved
249,339
boolean (@Nullable RefEntity entity) { return myResolvedElements.containsKey(entity) && !myProblemElements.containsKey(entity); }
isProblemResolved
249,340
Collection<RefEntity> () { return myResolvedElements.keys(); }
getResolvedElements
249,341
int (@NotNull ProblemDescriptorKey o) { if (file == null || o.file == null) { return Boolean.compare(file == null, o.file == null); } int comparison = file.getPath().compareTo(o.file.getPath()); if (comparison == 0) comparison = Integer.compare(lineNumber, o.lineNumber); if (comparison == 0) comparison = Integer.compar...
compareTo
249,342
boolean (@NotNull String inspectionsList, @NotNull String inspectionToolID) { Iterable<String> ids = StringUtil.tokenize(inspectionsList, "[, ]"); for (@NonNls String id : ids) { @NonNls String trim = id.trim(); if (trim.equals(inspectionToolID) || trim.equalsIgnoreCase(ALL)) return true; } return false; }
isInspectionToolIdMentioned
249,343
boolean (final @NotNull PsiElement place, final @NotNull String toolId, final @NotNull Class<? extends PsiElement> statementClass) { return ReadAction.compute(() -> getStatementToolSuppressedIn(place, toolId, statementClass)) != null; }
isSuppressedInStatement
249,344
PsiComment (@NotNull Project project, @NotNull String commentText, @NotNull Language language) { final PsiParserFacade parserFacade = PsiParserFacade.getInstance(project); return parserFacade.createLineOrBlockCommentFromText(language, commentText); }
createComment
249,345
boolean (@NotNull PsiElement comment) { final String prefix = getLineCommentPrefix(comment); final String commentText = comment.getText(); if (prefix != null) { return startsWithSuppressionTag(commentText, prefix); } final Couple<String> prefixSuffixPair = getBlockPrefixSuffixPair(comment); return prefixSuffixPair != n...
isSuppressionComment
249,346
boolean (@NotNull String commentText, @NotNull String prefix) { if (!commentText.startsWith(prefix)) { return false; } int index = CharArrayUtil.shiftForward(commentText, prefix.length(), " "); return index < commentText.length() && commentText.startsWith(SUPPRESS_INSPECTIONS_TAG_NAME, index); }
startsWithSuppressionTag
249,347
void (@NotNull PsiElement comment, @NotNull String id, boolean replaceOtherSuppressionIds, @NotNull Language commentLanguage) { final String oldSuppressionCommentText = comment.getText(); final String lineCommentPrefix = getLineCommentPrefix(comment); if (!replaceOtherSuppressionIds && oldSuppressionCommentText.contain...
replaceSuppressionComment
249,348
void (@NotNull Project project, @NotNull PsiElement container, @NotNull String id, @NotNull Language commentLanguage) { final String text = SUPPRESS_INSPECTIONS_TAG_NAME + " " + id; PsiComment comment = createComment(project, text, commentLanguage); container.getParent().addBefore(comment, container); }
createSuppression
249,349
boolean (@NotNull PsiElement psiElement, @NotNull String id) { for (InspectionExtensionsFactory factory : InspectionExtensionsFactory.EP_NAME.getExtensionList()) { if (!factory.isToCheckMember(psiElement, id)) { return true; } } return false; }
isSuppressed
249,350
boolean (@NotNull PsiElement place, @NotNull LocalInspectionTool tool) { return inspectionResultSuppressed(place, (InspectionProfileEntry)tool); }
inspectionResultSuppressed
249,351
boolean (@NotNull PsiElement place, @NotNull InspectionProfileEntry tool) { return tool.isSuppressedFor(place); }
inspectionResultSuppressed
249,352
String () { return InspectionsBundle.message("group.names.declaration.redundancy"); }
getGroupDisplayName
249,353
void (@NotNull PsiFile file, @NotNull InspectionManager manager, @NotNull ProblemsHolder problemsHolder, @NotNull GlobalInspectionContext globalContext, @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor) { InspectionSuppressor extension = ContainerUtil.find(LanguageInspectionSuppressors.INSTANCE.allFor...
checkFile
249,354
void (@NotNull PsiElement element) { super.visitElement(element); collectSuppressions(element, suppressedScopes, IGNORE_ALL, extension); }
visitElement
249,355
LocalInspectionTool (@NotNull RedundantSuppressionDetector suppressor, @NotNull Map<String, ? extends Set<PsiElement>> toolToSuppressScopes, @NotNull Set<String> activeTools) { return new LocalRedundantSuppressionInspection(suppressor, activeTools, toolToSuppressScopes); }
createLocalTool
249,356
boolean () { return false; }
worksInBatchModeOnly
249,357
GlobalInspectionContextBase (@NotNull PsiFile file) { InspectionManager inspectionManagerEx = InspectionManager.getInstance(file.getProject()); return (GlobalInspectionContextBase)inspectionManagerEx.createNewGlobalContext(); }
createContext
249,358
InspectionProfileImpl (@NotNull InspectionManager manager, @NotNull GlobalInspectionContext globalContext) { if (globalContext instanceof GlobalInspectionContextBase globalInspectionContext) { InspectionProfileImpl profile = globalInspectionContext.getCurrentProfile(); if (profile.getSingleTool() == null) { return prof...
getProfile
249,359
boolean (@NotNull PsiElement element, @NotNull Map<? super PsiElement, Collection<String>> suppressedScopes, boolean ignoreAll, @NotNull RedundantSuppressionDetector suppressor) { String idsString = suppressor.getSuppressionIds(element); if (idsString != null && !idsString.isEmpty()) { List<String> ids = new ArrayList<...
collectSuppressions
249,360
QuickFix<ProblemDescriptor> (@NotNull String key) { String[] toolAndLang = key.split(";"); Language language = toolAndLang.length < 2 ? null : Language.findLanguageByID(toolAndLang[1]); if (language == null) return null; InspectionSuppressor suppressor = ContainerUtil.find(LanguageInspectionSuppressors.INSTANCE.allForL...
createQuickFix
249,361
String () { return SHORT_NAME; }
getShortName
249,362
PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { return new PsiElementVisitor() { @Override public void visitElement(@NotNull PsiElement element) { super.visitElement(element); HashMap<PsiElement, Collection<String>> scopes = new HashMap<>(); boolean suppressAll = collectSuppressions(element, sc...
buildVisitor
249,363
void (@NotNull PsiElement element) { super.visitElement(element); HashMap<PsiElement, Collection<String>> scopes = new HashMap<>(); boolean suppressAll = collectSuppressions(element, scopes, IGNORE_ALL, mySuppressor); if (suppressAll) { return; } Collection<String> suppressIds = scopes.get(element); if (suppressIds != ...
visitElement
249,364
boolean (@NotNull PsiElement element, @NotNull String suppressId, Set<? extends PsiElement> suppressedPlaces) { return suppressedPlaces != null && ContainerUtil.exists(suppressedPlaces, place -> mySuppressor.isSuppressionFor(element, place, suppressId)); }
isSuppressedFor
249,365
String (@NotNull CommonProblemDescriptor descriptor, @Nullable PsiElement psiElement) { TextRange range = descriptor instanceof ProblemDescriptorBase ? ((ProblemDescriptorBase)descriptor).getTextRange() : null; return extractHighlightedText(range, psiElement); }
extractHighlightedText
249,366
String (@NotNull String text) { if (Verifier.checkCharacterData(text) == null) return text; return text.codePoints().map(cp -> Verifier.isXMLCharacter(cp) ? cp : '?') .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString(); }
sanitizeIllegalXmlChars
249,367
String (@Nullable TextRange range, @Nullable PsiElement psiElement) { if (psiElement == null || !psiElement.isValid()) return ""; String ref = psiElement.getText(); if (range != null) { final TextRange elementRange = psiElement.getTextRange(); if (elementRange != null) { range = range.shiftRight(-elementRange.getStartO...
extractHighlightedText
249,368
String (@NotNull CommonProblemDescriptor descriptor, @Nullable PsiElement element, boolean appendLineNumber) { return renderDescriptionMessage(descriptor, element, appendLineNumber ? APPEND_LINE_NUMBER : NONE); }
renderDescriptionMessage
249,369
ProblemPresentation (@NotNull CommonProblemDescriptor descriptor, @Nullable PsiElement element, @FlagConstant int flags) { NotNullLazyValue<@InspectionMessage String> descTemplate = NotNullLazyValue.volatileLazy( () -> StringUtil.notNullize(descriptor.getDescriptionTemplate())); NotNullLazyValue<@InspectionMessage Stri...
renderDescriptor
249,370
String () { return description.getValue(); }
getDescription
249,371
String () { return tooltip.getValue(); }
getTooltip
249,372
String (@NotNull String message) { message = StringUtil.replace(message, LOC_REFERENCE + " ", ""); message = StringUtil.replace(message, " " + LOC_REFERENCE, ""); message = StringUtil.replace(message, LOC_REFERENCE, ""); return message; }
removeLocReference
249,373
String (@NotNull String message) { message = StringUtil.replace(message, "<code>", "'"); message = StringUtil.replace(message, "</code>", "'"); message = message.contains(XML_CODE_MARKER.first) ? unescapeXmlCode(message) : !XmlStringUtil.isWrappedInHtml(message) ? StringUtil.unescapeXmlEntities(message) : message; retu...
unescapeTags
249,374
String (@NotNull String message) { List<String> strings = new ArrayList<>(); for (String string : StringUtil.split(message, XML_CODE_MARKER.first)) { if (string.contains(XML_CODE_MARKER.second)) { strings.addAll(StringUtil.split(string, XML_CODE_MARKER.second, false)); } else { strings.add(string); } } StringBuilder bu...
unescapeXmlCode
249,375
String (@NotNull CommonProblemDescriptor descriptor, @Nullable PsiElement element) { return renderDescriptionMessage(descriptor, element, false); }
renderDescriptionMessage
249,376
HighlightInfoType (@NotNull ProblemDescriptor problemDescriptor, @NotNull HighlightSeverity severity, @NotNull SeverityRegistrar severityRegistrar) { return getHighlightInfoType(problemDescriptor.getHighlightType(), severity, severityRegistrar); }
highlightTypeFromDescriptor
249,377
HighlightInfoType (@NotNull ProblemHighlightType highlightType, @NotNull HighlightSeverity severity, @NotNull SeverityRegistrar severityRegistrar) { return switch (highlightType) { case GENERIC_ERROR_OR_WARNING -> severityRegistrar.getHighlightInfoTypeBySeverity(severity); case LIKE_DEPRECATED -> new HighlightInfoType....
getHighlightInfoType
249,378
ProblemDescriptor (@NotNull PsiFile file, @NotNull HighlightSeverity severity, int startOffset, int endOffset, @NotNull @InspectionMessage String message, boolean isAfterEndOfLine, @NotNull LocalQuickFix @NotNull [] quickFixes) { if (severity == HighlightSeverity.INFORMATION || startOffset == endOffset && !isAfterEndOf...
convertToDescriptor
249,379
ProblemDescriptor (@NotNull PsiFile file, @NotNull HighlightInfo info) { List<LocalQuickFix> quickFixes = new ArrayList<>(); info.findRegisteredQuickFix((descriptor, range) -> { IntentionAction intention = descriptor.getAction(); LocalQuickFix fix = intention instanceof LocalQuickFix ? (LocalQuickFix)intention : intent...
toProblemDescriptor
249,380
InspectionUsageFUSStorage (Project project) { return project.getService(InspectionUsageFUSStorage.class); }
getInstance
249,381
void (@NotNull Set<String> inspectionIds) { inspectionsReportingProblems.addAll(inspectionIds); inspectionSessions.incrementAndGet(); }
reportInspectionsWhichReportedProblems
249,382
Report () { Set<String> old = inspectionsReportingProblems; inspectionsReportingProblems = newStorage(); int inspectionSessionCount = inspectionSessions.getAndSet(0); return new Report(old, inspectionSessionCount); }
collectHighligtingReport
249,383
record (@NotNull Set<@NotNull String> inspectionsReportingProblems, int inspectionSessionCount) {}
Report
249,384
String () { return myDescriptionTemplate; }
toString
249,385
void (Class<?> clazz, List<Class<?>> supers) { Class<?>[] interfaces = clazz.getInterfaces(); addAll(supers, interfaces); for (Class<?> anInterface : interfaces) { supers.addAll(getAllSupers(anInterface)); } }
addInterfaces
249,386
record (boolean hasBasicVisitor, List<Class<?>> handlesElementTypes, boolean overridesVisitPsiElement) { }
VisitorTypes
249,387
VisitorTypes (Class<?> type) { List<Class<?>> visitClasses = new ArrayList<>(); Collection<String> visitorClasses = BasicInspectionVisitorBean.getVisitorClasses(); Class<?> superClass = type; while (superClass != null) { if (superClass == PsiElementVisitor.class) { // no `inspection.basicVisitor` defined in hierarchy r...
computeValue
249,388
String (@NotNull String message) { //TODO: FIXME! return message + LOC_MARKER; }
createInspectionMessage
249,389
void (@NotNull PsiElement elt, @NotNull HighlightInfo info, TextRange range, @Nullable ProblemGroup problemGroup, @NotNull InspectionManager manager, @NotNull ProblemDescriptionsProcessor problemDescriptionsProcessor, @NotNull GlobalInspectionContext globalContext) { List<LocalQuickFix> fixes = new ArrayList<>(); info....
createProblem
249,390
void (@NotNull PsiFile file) { ProblemDescriptor[] descriptors = checkFileWithExternalAnnotator(file, myHolder.getManager(), myIsOnTheFly, myAnnotator); addDescriptors(descriptors); }
visitFile
249,391
void (ProblemDescriptor @NotNull [] descriptors) { for (ProblemDescriptor descriptor : descriptors) { LOG.assertTrue(descriptor != null, getClass().getName()); myHolder.registerProblem(descriptor); } }
addDescriptors
249,392
String () { return myAction.getText(); }
getName
249,393
String () { return myAction.getFamilyName(); }
getFamilyName
249,394
void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { myAction.invoke(project, null, getPsiFile(descriptor)); }
applyFix
249,395
IntentionPreviewInfo (@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) { return myAction.generatePreview(project, Objects.requireNonNull(IntentionPreviewUtils.getPreviewEditor()), Objects.requireNonNull(getPsiFile(previewDescriptor))); }
generatePreview
249,396
Icon (@IconFlags int flags) { if (myAction instanceof Iconable) { return ((Iconable) myAction).getIcon(flags); } return null; }
getIcon
249,397
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LocalQuickFixBackedByIntentionAction action = (LocalQuickFixBackedByIntentionAction)o; return myAction.equals(action.myAction); }
equals
249,398
int () { return myAction.hashCode(); }
hashCode
249,399
boolean () { return myOnTheFly; }
isOnTheFly