Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
249,500
ScopeToolState (@NotNull NamedScope scope, @NotNull InspectionToolWrapper<?,?> toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level) { return insertTool(scope, toolWrapper, enabled, level, 0); }
prependTool
249,501
ScopeToolState (@NotNull String scopeName, @NotNull InspectionToolWrapper<?,?> toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level) { return insertTool(new ScopeToolState(scopeName, toolWrapper, enabled, level), myTools != null ? myTools.size() : 0); }
addTool
249,502
ScopeToolState (@NotNull NamedScope scope, @NotNull InspectionToolWrapper<?,?> toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level, int idx) { return insertTool(new ScopeToolState(scope, toolWrapper, enabled, level), idx); }
insertTool
249,503
ScopeToolState (@NotNull ScopeToolState scopeToolState, int idx) { if (myTools == null) { myTools = new ArrayList<>(); if (scopeToolState.isEnabled()) { setEnabled(true); } } myTools.add(idx, scopeToolState); return scopeToolState; }
insertTool
249,504
String () { return myShortName; }
getShortName
249,505
void (@NotNull Element inspectionElement) { if (myTools != null) { for (ScopeToolState state : myTools) { Element scopeElement = new Element("scope"); scopeElement.setAttribute("name", state.getScopeName()); scopeElement.setAttribute(LEVEL_ATTRIBUTE, state.getLevel().getName()); scopeElement.setAttribute(ENABLED_ATTRIB...
writeExternal
249,506
List<ScopeToolState> () { if (myTools == null) { return Collections.singletonList(myDefaultState); } List<ScopeToolState> result = new ArrayList<>(myTools); result.add(myDefaultState); return result; }
getTools
249,507
void (@NotNull List<? super ScopeToolState> result) { if (myTools != null) { result.addAll(myTools); } result.add(myDefaultState); }
collectTools
249,508
ScopeToolState () { return myDefaultState; }
getDefaultState
249,509
void (@NotNull String scopeName) { if (myTools != null) { for (ScopeToolState tool : myTools) { if (scopeName.equals(tool.getScopeName())) { myTools.remove(tool); break; } } checkToolsIsEmpty(); } }
removeScope
249,510
void () { if (myTools.isEmpty()) { myTools = null; setEnabled(myDefaultState.isEnabled()); } }
checkToolsIsEmpty
249,511
void () { myTools = null; }
removeAllScopes
249,512
void (int idx, @NotNull NamedScope namedScope) { if (myTools != null && myTools.size() > idx && idx >= 0) { ScopeToolState scopeToolState = myTools.get(idx); InspectionToolWrapper<?,?> toolWrapper = scopeToolState.getTool(); myTools.remove(idx); myTools.add(idx, new ScopeToolState(namedScope, toolWrapper, scopeToolStat...
setScope
249,513
HighlightDisplayLevel (@Nullable PsiElement element) { return getState(element).getLevel(); }
getLevel
249,514
ScopeToolState (@Nullable PsiElement element) { if (myTools == null || element == null) return myDefaultState; return ReadAction.compute(() -> { if (!element.isValid()) return myDefaultState; Project project = element.getProject(); DependencyValidationManager manager = DependencyValidationManager.getInstance(project); ...
getState
249,515
HighlightDisplayLevel () { return myDefaultState.getLevel(); }
getLevel
249,516
boolean () { return myEnabled; }
isEnabled
249,517
boolean (PsiElement element) { if (!myEnabled) return false; return getState(element).isEnabled(); }
isEnabled
249,518
boolean (ScopeToolState state) { HighlightDisplayLevel level = state.getLevel(); return !(HighlightDisplayLevel.DO_NOT_SHOW.equals(level) || HighlightDisplayLevel.CONSIDERATION_ATTRIBUTES.equals(level)); }
isAvailableInBatch
249,519
void (boolean enabled) { myEnabled = enabled; }
setEnabled
249,520
void (@NotNull NamedScope namedScope, Project project) { if (myTools != null) { for (ScopeToolState state : myTools) { if (namedScope.equals(state.getScope(project))) { state.setEnabled(true); } } } setEnabled(true); }
enableTool
249,521
void (@NotNull PsiElement element) { Project project = element.getProject(); DependencyValidationManager validationManager = DependencyValidationManager.getInstance(project); if (myTools != null) { for (ScopeToolState state : myTools) { NamedScope scope = state.getScope(project); if (scope != null) { PackageSet package...
disableTool
249,522
HighlightDisplayLevel (NamedScope scope, Project project) { if (myTools != null && scope != null){ for (ScopeToolState state : myTools) { if (Comparing.equal(state.getScope(project), scope)) { return state.getLevel(); } } } return myDefaultState.getLevel(); }
getLevel
249,523
HighlightDisplayLevel (String scope, Project project) { if (myTools != null && scope != null){ for (ScopeToolState state : myTools) { final NamedScope stateScope = state.getScope(project); if (stateScope != null && scope.equals(stateScope.getScopeId())) { return state.getLevel(); } } } return myDefaultState.getLevel();...
getLevel
249,524
int () { return Objects.hash(myEnabled, getTools().size()); }
hashCode
249,525
boolean (Object o) { if (!(o instanceof ToolsImpl tools)) return false; if (myEnabled != tools.myEnabled) return false; if (getTools().size() != tools.getTools().size()) return false; for (int i = 0; i < getTools().size(); i++) { ScopeToolState state = getTools().get(i); ScopeToolState toolState = tools.getTools().get(...
equals
249,526
void (@Nullable String externalName, @Nullable String scopeName) { if (scopeName == null) { myDefaultState.setEditorAttributesExternalName(externalName); } else { if (myTools == null) return; for (ScopeToolState tool : myTools) { if (scopeName.equals(tool.getScopeName())) { tool.setEditorAttributesExternalName(external...
setEditorAttributesKey
249,527
void (HighlightDisplayLevel level, PsiElement element) { getState(element).setLevel(level); }
setLevel
249,528
void (@NotNull HighlightDisplayLevel level, @Nullable String scopeName, Project project) { if (scopeName == null) { myDefaultState.setLevel(level); } else { if (myTools == null) { return; } ScopeToolState scopeToolState = null; int index = -1; for (int i = 0; i < myTools.size(); i++) { ScopeToolState tool = myTools.get...
setLevel
249,529
void (@NotNull InspectionToolWrapper<?,?> toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level) { myDefaultState.setTool(toolWrapper); myDefaultState.setLevel(level); myDefaultState.setEnabled(enabled); }
setDefaultState
249,530
void (@NotNull InspectionToolWrapper<?,?> toolWrapper, boolean enabled, @NotNull HighlightDisplayLevel level, @Nullable String attributesKey) { setDefaultState(toolWrapper, enabled, level); myDefaultState.setEditorAttributesExternalName(attributesKey); }
setDefaultState
249,531
void (@NotNull HighlightDisplayLevel level) { myDefaultState.setLevel(level); }
setLevel
249,532
void () { if (myDefaultState.isEnabled()) { return; } if (myTools != null) { for (ScopeToolState tool : myTools) { if (tool.isEnabled()) { return; } } } setEnabled(false); }
disableWholeToolIfCan
249,533
RefElement (@NotNull PsiElement element, @NotNull GlobalInspectionContext globalContext) { PsiFile elementFile = element.getContainingFile(); RefElement refElement = globalContext.getRefManager().getReference(elementFile); if (refElement == null) { PsiElement context = InjectedLanguageManager.getInstance(elementFile.ge...
retrieveRefElement
249,534
boolean (@NotNull Project project, boolean online, @NotNull Runnable rerunAction) { if (InspectionExtensionsFactory.EP_NAME.getExtensionList().isEmpty()) { return true; } for (InspectionExtensionsFactory factory : InspectionExtensionsFactory.EP_NAME.getExtensionList()) { if (factory.isProjectConfiguredToRunInspections(...
canRunInspections
249,535
HintAction () { return myHintAction; }
getHintAction
249,536
int (@Nullable Tools object) { return object == null ? 0 : object.getShortName().hashCode(); }
hashCode
249,537
boolean (@Nullable Tools o1, @Nullable Tools o2) { return o1 == o2 || (o1 != null && o2 != null && o1.getShortName().equals(o2.getShortName())); }
equals
249,538
AnalysisScope () { return myCurrentScope; }
getCurrentScope
249,539
Project () { return myProject; }
getProject
249,540
InspectionProfileImpl () { if (myExternalProfile != null) { return myExternalProfile; } String currentProfile = ((InspectionManagerBase)InspectionManager.getInstance(myProject)).getCurrentProfile(); InspectionProfileImpl profile = ProjectInspectionProfileManager.getInstance(myProject).getProfile(currentProfile, false);...
getCurrentProfile
249,541
boolean (@NotNull RefEntity entity, @NotNull GlobalInspectionTool tool) { return !(entity instanceof RefElementImpl) || isToCheckMember((RefElementImpl)entity, tool); }
shouldCheck
249,542
boolean (@NotNull PsiElement element, @NotNull String id) { RefManagerImpl refManager = (RefManagerImpl)getRefManager(); if (refManager.isDeclarationsFound()) { RefElement refElement = refManager.getReference(element); return refElement instanceof RefElementImpl && ((RefElementImpl)refElement).isSuppressed(id); } retur...
isSuppressed
249,543
void (@NotNull AnalysisScope currentScope) { myCurrentScope = currentScope; }
setCurrentScope
249,544
void (@NotNull Runnable action) { myRerunAction = action; }
setRerunAction
249,545
void (@NotNull AnalysisScope scope) { if (!GlobalInspectionContextUtil.canRunInspections(myProject, true, myRerunAction)) return; cleanup(); ApplicationManager.getApplication().invokeLater(() -> { myCurrentScope = scope; launchInspections(scope); }, myProject.getDisposed()); }
doInspections
249,546
RefManager () { RefManager refManager = myRefManager; if (refManager == null) { myRefManager = refManager = DumbService.getInstance(myProject).runReadActionInSmartMode(() -> new RefManagerImpl(myProject, myCurrentScope, this)); } return refManager; }
getRefManager
249,547
boolean (@NotNull RefElement owner, @NotNull InspectionProfileEntry tool) { return isToCheckFile(((RefElementImpl)owner).getContainingFile(), tool) && !((RefElementImpl)owner).isSuppressed(tool.getShortName(), tool.getAlternativeID()); }
isToCheckMember
249,548
boolean (@Nullable PsiFileSystemItem file, @NotNull InspectionProfileEntry tool) { Tools tools = getTools().get(tool.getShortName()); if (tools != null && file != null) { for (ScopeToolState state : tools.getTools()) { NamedScope namedScope = state.getScope(file.getProject()); if (namedScope == null || namedScope.getVa...
isToCheckFile
249,549
void (@NotNull AnalysisScope scope) { ApplicationManager.getApplication().assertWriteIntentLockAcquired(); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); LOG.info("Code inspection started"); InspectionProfileImpl profile = getCurrentProfile(); String title = profile.getSingleTool() == null ? AnalysisBu...
launchInspections
249,550
void (@NotNull ProgressIndicator indicator) { performInspectionsWithProgress(scope, false, false); }
run
249,551
void () { notifyInspectionsFinished(scope); }
onSuccess
249,552
void () { // execute cleanup in EDT because of myTools cleanup(); }
onCancel
249,553
PerformInBackgroundOption () { return PerformInBackgroundOption.ALWAYS_BACKGROUND; }
createOption
249,554
void (@NotNull AnalysisScope scope) { }
notifyInspectionsFinished
249,555
void (@NotNull AnalysisScope scope, boolean runGlobalToolsOnly, boolean isOfflineInspections) { myProgressIndicator = ProgressManager.getInstance().getProgressIndicator(); if (!(myProgressIndicator instanceof ProgressIndicatorEx) || !(myProgressIndicator instanceof ProgressIndicatorWithDelayedPresentation)) { throw new...
performInspectionsWithProgress
249,556
void () { super.cancel(); canceled(); }
cancel
249,557
void () { }
canceled
249,558
void (@NotNull AnalysisScope scope, boolean runGlobalToolsOnly, boolean isOfflineInspections) { }
runTools
249,559
void (@NotNull List<Tools> outGlobalTools, @NotNull List<Tools> outLocalTools, @NotNull List<? super Tools> outGlobalSimpleTools) { List<Tools> usedTools = getUsedTools(); Map<String, Tools> tools = new HashMap<>(usedTools.size()); for (Tools currentTools : usedTools) { String shortName = currentTools.getShortName(); t...
initializeTools
249,560
List<Tools> () { InspectionProfileImpl profile = getCurrentProfile(); List<Tools> tools = profile.getAllEnabledInspectionTools(myProject); Set<InspectionToolWrapper<?, ?>> dependentTools = new LinkedHashSet<>(); for (Tools tool : tools) { profile.collectDependentInspections(tool.getTool(), dependentTools, getProject())...
getUsedTools
249,561
void (@NotNull List<? super Tools> outGlobalTools, @NotNull List<? super Tools> outLocalTools, @NotNull List<? super Tools> outGlobalSimpleTools, @NotNull Tools currentTools, @NotNull InspectionToolWrapper<?,?> toolWrapper) { if (toolWrapper instanceof LocalInspectionToolWrapper) { outLocalTools.add(currentTools); } el...
classifyTool
249,562
void (@NotNull JobDescriptor job) { if (!myJobDescriptors.contains(job)) { myJobDescriptors.add(job); job.setDoneAmount(0); } }
appendJobDescriptor
249,563
void (@NotNull AnalysisScope scope, @NotNull InspectionProfile profile, @Nullable String commandName, @Nullable Runnable postRunnable, boolean modal, @NotNull Predicate<? super ProblemDescriptor> shouldApplyFix) {}
codeCleanup
249,564
void (@NotNull AnalysisScope scope, @NotNull InspectionProfile profile, @Nullable String commandName, @Nullable Runnable postRunnable, boolean modal) { codeCleanup(scope, profile, commandName, postRunnable, modal, Predicates.alwaysTrue()); }
codeCleanup
249,565
void (@NotNull Project project, @Nullable Runnable runnable, PsiElement @NotNull ... scope) { cleanupElements(project, runnable, Predicates.alwaysTrue(), scope); }
cleanupElements
249,566
void (@NotNull Project project, @Nullable Runnable runnable, Predicate<? super ProblemDescriptor> shouldApplyFix, PsiElement @NotNull ... scope) { List<SmartPsiElementPointer<PsiElement>> elements = new ArrayList<>(); SmartPointerManager manager = SmartPointerManager.getInstance(project); for (PsiElement element : scop...
cleanupElements
249,567
void (@NotNull Project project, @Nullable Runnable runnable, List<? extends SmartPsiElementPointer<PsiElement>> elements) { cleanupElements(project, runnable, elements, Predicates.alwaysTrue()); }
cleanupElements
249,568
void (@NotNull Project project, @Nullable Runnable runnable, List<? extends SmartPsiElementPointer<PsiElement>> elements, @NotNull Predicate<? super ProblemDescriptor> shouldApplyFix) { ApplicationManager.getApplication().invokeLater(() -> { List<PsiElement> psiElements = new ArrayList<>(); for (SmartPsiElementPointer<...
cleanupElements
249,569
void (boolean noSuspiciousCodeFound) { cleanup(); }
close
249,570
void () { cleanupTools(); }
cleanup
249,571
void (@NotNull JobDescriptor job, @NotNull @NlsContexts.ProgressText String message) { ProgressManager.checkCanceled(); int old = job.getDoneAmount(); job.setDoneAmount(old + 1); float totalProgress = getTotalProgress(); myProgressIndicator.setFraction(totalProgress); myProgressIndicator.setText(job.getDisplayName() + ...
incrementJobDoneAmount
249,572
float () { int totalDone = 0; int totalTotal = 0; for (JobDescriptor jobDescriptor : myJobDescriptors) { totalDone += jobDescriptor.getDoneAmount(); totalTotal += jobDescriptor.getTotalAmount(); } return totalTotal == 0 ? 1 : 1.0f * totalDone / totalTotal; }
getTotalProgress
249,573
void (InspectionProfileImpl profile) { myExternalProfile = profile; }
setExternalProfile
249,574
StdJobDescriptors () { return myStdJobDescriptors; }
getStdJobDescriptors
249,575
DaemonProgressIndicator () { ProgressIndicator indicator = ProgressIndicatorProvider.getGlobalProgressIndicator(); ProgressIndicator original = indicator == null ? null : ProgressWrapper.unwrapAll(indicator); if (!(original instanceof DaemonProgressIndicator)) { throw new IllegalStateException("must be run under Daemon...
assertUnderDaemonProgress
249,576
GlobalInspectionToolWrapper () { return new GlobalInspectionToolWrapper(this); }
createCopy
249,577
void (@NotNull GlobalInspectionContext context) { RefManagerImpl refManager = (RefManagerImpl)context.getRefManager(); final RefGraphAnnotator annotator = getTool().getAnnotator(refManager); if (annotator != null) { refManager.registerGraphAnnotator(annotator); } super.initialize(context); }
initialize
249,578
boolean () { return getTool().worksInBatchModeOnly(); }
worksInBatchModeOnly
249,579
String () { return GlobalInspectionToolWrapper.this.getDisplayName(); }
getDisplayName
249,580
String () { return NAME; }
getFormatName
249,581
boolean () { return true; }
useTmpDirForRawData
249,582
int (final @NotNull File inspectionResultData, final @NotNull InspectionToolWrapper toolWrapper, final @NotNull List problems) { int maxFileColonLineLength = 0; for (Object problem : problems) { final Element fileElement = ((Element)problem).getChild(FILE_ELEMENT); final Element lineElement = ((Element)problem).getChil...
getMaxFileColonLineNumLength
249,583
void (String msg) { System.err.println(msg); }
warn
249,584
boolean (final @NotNull File file, final @NotNull InspectionToolWrapper toolWrapper) { // TODO: check according to config return false; }
resultsIgnored
249,585
String (final @NotNull Element fileElement) { return fileElement.getText().replace("file://$PROJECT_DIR$", "."); }
getPath
249,586
void (@NotNull AnalysisScope scope, @NotNull Path outputPath, boolean runGlobalToolsOnly, @NotNull List<? super Path> inspectionsResults) { performInspectionsWithProgressAndExportResults(scope, runGlobalToolsOnly, true, outputPath, inspectionsResults); }
launchInspectionsOffline
249,587
void (@NotNull AnalysisScope scope, boolean runGlobalToolsOnly, boolean isOfflineInspections, @NotNull Path outputDir, @NotNull List<? super Path> inspectionsResults) { cleanupTools(); setCurrentScope(scope); myOutputDir = outputDir; try { try { performInspectionsWithProgress(scope, runGlobalToolsOnly, isOfflineInspect...
performInspectionsWithProgressAndExportResults
249,588
void (@NotNull List<? super Path> inspectionsResults, @NotNull List<? extends Tools> inspections, @NotNull Path outputDir, @Nullable XMLOutputFactory xmlOutputFactory) { if (xmlOutputFactory == null) { xmlOutputFactory = XMLOutputFactory.newDefaultFactory(); } BufferedWriter[] writers = new BufferedWriter[inspections.s...
exportResults
249,589
void (@NotNull RefEntity refEntity) { for (int i = 0; i < states.size(); i++) { for (ScopeToolState state : states.get(i)) { try { InspectionToolWrapper<?, ?> toolWrapper = state.getTool(); BufferedWriter writer = writers[i]; if (writer != null && (myGlobalReportedProblemFilter == null || myGlobalReportedProblemFilter....
visitElement
249,590
void (@NotNull List<? super Path> inspectionsResults, @NotNull Path outputDir) { List<Tools> globalToolsWithProblems = new ArrayList<>(); List<Tools> toolsWithResultsToAggregate = new ArrayList<>(); for (Map.Entry<String, Tools> entry : getTools().entrySet()) { Tools sameTools = entry.getValue(); boolean hasProblems = ...
exportResultsSmart
249,591
void (@NotNull List<? super Path> inspectionsResults, @NotNull List<? extends Tools> toolsWithResultsToAggregate, @NotNull Path outputPath) { for (Tools tools : toolsWithResultsToAggregate) { String inspectionName = tools.getShortName(); inspectionsResults.add(InspectionsResultUtil.getInspectionResultPath(outputPath, i...
exportResultsWithAggregation
249,592
InspectionToolResultExporter (@NotNull InspectionToolWrapper<?, ?> toolWrapper) { InspectionToolResultExporter presentation = myPresentationMap.get(toolWrapper); if (presentation == null) { presentation = createPresentation(toolWrapper); presentation = ConcurrencyUtil.cacheOrGet(myPresentationMap, toolWrapper, presenta...
getPresentation
249,593
InspectionToolResultExporter (@NotNull InspectionToolWrapper<?, ?> toolWrapper) { String presentationClass = StringUtil .notNullize(toolWrapper.myEP == null ? null : toolWrapper.myEP.presentation, DefaultInspectionToolResultExporter.class.getName()); try { InspectionToolResultExporter presentation; InspectionEP extensi...
createPresentation
249,594
ReportedProblemFilter () { return myReportedProblemFilter; }
getReportedProblemFilter
249,595
void (ReportedProblemFilter reportedProblemFilter) { myReportedProblemFilter = reportedProblemFilter; }
setReportedProblemFilter
249,596
GlobalReportedProblemFilter () { return myGlobalReportedProblemFilter; }
getGlobalReportedProblemFilter
249,597
void (GlobalReportedProblemFilter reportedProblemFilter) { myGlobalReportedProblemFilter = reportedProblemFilter; }
setGlobalReportedProblemFilter
249,598
void () { myProfile = new ConcurrentHashMap<>(); }
startPathProfiling
249,599
void (@NotNull InspectionProblemConsumer problemConsumer) { myProblemConsumer = problemConsumer; }
setProblemConsumer