Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
249,000
Color (int colorIndex) { return myRainbowColors[colorIndex]; }
calculateForeground
249,001
int () { return myRainbowColors.length; }
getColorsCount
249,002
Color (@NotNull List<? extends Pair<Color, Double>> colorCircles, @NotNull Color sampleColor, int nestLevel) { if (nestLevel > 4) { return sampleColor; } for (Pair<Color, Double> circle: colorCircles) { Color paletteColor = circle.first; double distance = colorDistance01(sampleColor, paletteColor); if (distance < circl...
resolveConflict
249,003
int (double b) { return MathUtil.clamp((int)b, 1, 254); }
normalize
249,004
double (@NotNull Color c1, @NotNull Color c2) { return getLength(YPbPr01(rgbDiffColor(c1, c2))); }
colorDistance01
249,005
double (float @NotNull [] components) { return Math.sqrt(components[0] * components[0] + components[1] * components[1] + components[2] * components[2]); }
getLength
249,006
void (@NotNull TextAttributes attributes, @Nullable Color rainbowColor) { attributes.setForegroundColor(rainbowColor); }
setRainbowColorToAttribute
249,007
boolean (TextAttributesKey key) { return key.getExternalName().startsWith(RAINBOW_TEMP_PREF); }
isRainbowTempKey
249,008
HighlightInfo (int colorIndex, @Nullable PsiElement id, @Nullable TextAttributesKey colorKey) { return id == null ? null : getInfoBuilder(colorIndex, colorKey).range(id).create(); }
getInfo
249,009
HighlightInfo (int colorIndex, int start, int end, @Nullable TextAttributesKey colorKey) { return getInfoBuilder(colorIndex, colorKey).range(start, end).create(); }
getInfo
249,010
TextAttributes (@Nullable Color color) { TextAttributes ret = new TextAttributes(); setRainbowColorToAttribute(ret, color); return ret; }
createRainbowAttribute
249,011
void (@NotNull ProgressIndicator progress) { if (!isValid()) return; //the document has changed. GlobalInspectionContextBase.assertUnderDaemonProgress(); myDumb = DumbService.getInstance(myProject).isDumb(); doCollectInformation(progress); }
collectInformation
249,012
void (@Nullable EditorColorsScheme colorsScheme) { myColorsScheme = colorsScheme; }
setColorsScheme
249,013
boolean () { return myDumb; }
isDumbMode
249,014
boolean () { if (myProject.isDisposed()) { return false; } if (isDumbMode() && !DumbService.isDumbAware(this)) { return false; } if (PsiModificationTracker.getInstance(myProject).getModificationCount() != myInitialPsiStamp) { return false; } if (myDocument.getModificationStamp() != myInitialDocStamp) return false; PsiF...
isValid
249,015
void () { if (!isValid()) { return; // the document has changed. } if (DumbService.getInstance(myProject).isDumb() && !DumbService.isDumbAware(this)) { Document document = getDocument(); PsiFile file = PsiDocumentManager.getInstance(myProject).getPsiFile(document); if (file != null) { DaemonCodeAnalyzerEx.getInstanceEx...
applyInformationToEditor
249,016
int () { return myId; }
getId
249,017
void (int id) { myId = id; }
setId
249,018
List<HighlightInfo> () { return Collections.emptyList(); }
getInfos
249,019
void (int @NotNull [] completionPredecessorIds) { myCompletionPredecessorIds = completionPredecessorIds; }
setCompletionPredecessorIds
249,020
Document () { return myDocument; }
getDocument
249,021
void (int @NotNull [] startingPredecessorIds) { myStartingPredecessorIds = startingPredecessorIds; }
setStartingPredecessorIds
249,022
boolean () { return myRunIntentionPassAfter; }
isRunIntentionPassAfter
249,023
List<NamedScope> () { return CustomScopesAggregator.getAllCustomScopes(myProject); }
getPredefinedScopes
249,024
NamedScope (@NotNull String name) { for (CustomScopesProvider scopesProvider : CustomScopesProvider.CUSTOM_SCOPES_PROVIDER.getExtensions(myProject)) { final NamedScope scope = scopesProvider instanceof CustomScopesProviderEx ? ((CustomScopesProviderEx)scopesProvider).getCustomScope(name) : CustomScopesProviderEx.findPr...
getPredefinedScope
249,025
boolean () { return !myState.rules.isEmpty(); }
hasRules
249,026
boolean () { return mySkipImportStatements; }
skipImportStatements
249,027
void (final boolean skip) { mySkipImportStatements = skip; }
setSkipImportStatements
249,028
void () { myState.rules.clear(); }
removeAllRules
249,029
void (@NotNull DependencyRule rule, @NotNull State state) { appendUnnamedScope(rule.getFromScope(), state); appendUnnamedScope(rule.getToScope(), state); state.rules.add(rule); }
addRule
249,030
void (@NotNull DependencyRule rule) { addRule(rule, myState); }
addRule
249,031
void (@NotNull NamedScope fromScope, @NotNull State state) { if (getScope(fromScope.getScopeId()) == null) { final PackageSet packageSet = fromScope.getValue(); if (packageSet != null && !state.unnamedScopes.containsKey(packageSet.getText())) { state.unnamedScopes.put(packageSet.getText(), packageSet); } } }
appendUnnamedScope
249,032
String () { return AnalysisBundle.message("shared.scopes.node.text"); }
getDisplayName
249,033
Icon () { return ourSharedScopeIcon; }
getIcon
249,034
void (@NotNull Element element) { Element option = element.getChild("option"); if (option != null && "SKIP_IMPORT_STATEMENTS".equals(option.getAttributeValue("name"))) { mySkipImportStatementsWasSpecified = !myProject.isDefault(); mySkipImportStatements = Boolean.parseBoolean(option.getAttributeValue("value")); } super...
loadState
249,035
void (@NotNull Element element, State state) { for (Element rule1 : element.getChildren(DENY_RULE_KEY)) { DependencyRule rule = readRule(rule1); if (rule != null) { addRule(rule, state); } } }
readRules
249,036
Element () { Element element = super.getState(); if (mySkipImportStatements || mySkipImportStatementsWasSpecified) { element.addContent(new Element("option").setAttribute("name", "SKIP_IMPORT_STATEMENTS").setAttribute("value", Boolean.toString(mySkipImportStatements))); } State state = myState; if (!state.unnamedScopes...
getState
249,037
void (@NotNull Element element, @NotNull State state) { for (DependencyRule rule : state.rules) { Element ruleElement = writeRule(rule); if (ruleElement != null) { element.addContent(ruleElement); } } }
writeRules
249,038
NamedScope (@Nullable String name, @NotNull State state) { final NamedScope scope = super.getScope(name); if (scope == null) { final PackageSet packageSet = state.unnamedScopes.get(name); if (packageSet != null) { return new NamedScope.UnnamedScope(packageSet); } } //compatibility for predefined scopes: rename Project ...
getScope
249,039
String (@NotNull Element element) { return element.getAttributeValue("name"); }
getSubStateFileName
249,040
String () { return "scope_settings"; }
getComponentStateFileName
249,041
String () { return "scope"; }
getSubStateTagName
249,042
void () { UIUtil.invokeLaterIfNeeded(() -> { if (getProject().isDisposed()) { return; } List<Pair<NamedScope, NamedScopesHolder>> scopeList = new ArrayList<>(); addScopesToList(scopeList, this); addScopesToList(scopeList, myNamedScopeManager); myScopePairs.clear(); myScopePairs.addAll(scopeList); Element element = new ...
reloadScopes
249,043
void (final @NotNull List<? super Pair<NamedScope, NamedScopesHolder>> scopeList, final @NotNull NamedScopesHolder holder) { for (NamedScope scope : holder.getScopes()) { scopeList.add(Pair.create(scope, holder)); } }
addScopesToList
249,044
void () { super.fireScopeListeners(); reloadScopes(); }
fireScopeListeners
249,045
void (NamedScope @NotNull [] scopes) { super.setScopes(scopes); final List<String> order = myNamedScopeManager.myOrderState.myOrder; order.clear(); for (NamedScope scope : scopes) { order.add(scope.getScopeId()); } }
setScopes
249,046
String () { return AnalysisBundle.message("backward.dependencies.usage.view.root.node.text"); }
getRootNodeNameInUsageView
249,047
String () { return AnalysisBundle.message("backward.dependencies.usage.view.initial.text"); }
getInitialUsagesPosition
249,048
AnalysisScope () { return myScopeOfInterest; }
getScopeOfInterest
249,049
boolean () { return true; }
isBackward
249,050
void () { final DependenciesBuilder builder = new ForwardDependenciesBuilder(getProject(), myForwardScope); builder.setTotalFileCount(myTotalFileCount); builder.analyze(); subtractScope(builder, getScope()); final PsiManager psiManager = PsiManager.getInstance(getProject()); psiManager.runInBatchFilesMode(() -> { final...
doAnalyze
249,051
void (final DependenciesBuilder builders, final AnalysisScope scope) { final Map<PsiFile, Set<PsiFile>> dependencies = builders.getDependencies(); Set<PsiFile> excluded = new HashSet<>(); for (final PsiFile psiFile : dependencies.keySet()) { if (scope.contains(psiFile)) { excluded.add(psiFile); } } for ( final PsiFile ...
subtractScope
249,052
AnalysisScope () { return myForwardScope; }
getForwardScope
249,053
void (final int fileCount) { myFileCount = fileCount; }
setInitialFileCount
249,054
void (final int totalFileCount) { myTotalFileCount = totalFileCount; }
setTotalFileCount
249,055
AnalysisScope () { return myScope; }
getScope
249,056
Project () { return myProject; }
getProject
249,057
void () { doAnalyze(); myIllegalDependencies = ReadAction.compute(this::doGetIllegalDependencies); }
analyze
249,058
List<List<PsiFile>> (PsiFile from, PsiFile to) { return findPaths(from, to, new HashSet<>()); }
findPaths
249,059
List<List<PsiFile>> (PsiFile from, PsiFile to, Set<? super PsiFile> processed) { final List<List<PsiFile>> result = new ArrayList<>(); final Set<PsiFile> reachable = getDirectDependencies().get(from); if (reachable != null) { if (reachable.contains(to)) { result.add(new ArrayList<>()); return result; } if (processed.ad...
findPaths
249,060
void (@NotNull PsiFile file, @NotNull DependencyProcessor processor) { analyzeFileDependencies(file, processor, DependencyVisitorFactory.VisitorOptions.fromSettings(file.getProject())); }
analyzeFileDependencies
249,061
void (@NotNull PsiFile file, @NotNull DependencyProcessor processor, @NotNull DependencyVisitorFactory.VisitorOptions options) { Boolean prev = file.getUserData(PsiFileEx.BATCH_REFERENCE_PROCESSING); file.putUserData(PsiFileEx.BATCH_REFERENCE_PROCESSING, Boolean.TRUE); try { file.accept(DependencyVisitorFactory.createV...
analyzeFileDependencies
249,062
boolean () { return true; }
skipImports
249,063
boolean () { return false; }
skipImports
249,064
VisitorOptions (@NotNull Project project) { final DependencyValidationManager manager = DependencyValidationManager.getInstance(project); return new VisitorOptions() { @Override public boolean skipImports() { return manager.skipImportStatements(); } }; }
fromSettings
249,065
boolean () { return manager.skipImportStatements(); }
skipImports
249,066
PsiElementVisitor (@NotNull PsiFile file, @NotNull DependenciesBuilder.DependencyProcessor processor, @NotNull VisitorOptions options) { DependencyVisitorFactory factory = EP_NAME.forLanguage(file.getLanguage()); return factory != null ? factory.getVisitor(processor, options) : new DefaultVisitor(processor); }
createVisitor
249,067
void (@NotNull PsiElement element) { super.visitElement(element); for (PsiReference ref : element.getReferences()) { PsiElement resolved = ref.resolve(); if (resolved != null) { myProcessor.process(ref.getElement(), resolved); } } }
visitElement
249,068
String () { return AnalysisBundle.message("forward.dependencies.usage.view.root.node.text"); }
getRootNodeNameInUsageView
249,069
String () { return AnalysisBundle.message("forward.dependencies.usage.view.initial.text"); }
getInitialUsagesPosition
249,070
boolean () { return false; }
isBackward
249,071
void () { final PsiManager psiManager = PsiManager.getInstance(getProject()); psiManager.runInBatchFilesMode(() -> { final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(getProject()).getFileIndex(); getScope().acceptIdempotentVisitor(new PsiRecursiveElementVisitor() { @Override public void visitFile(final...
doAnalyze
249,072
void (final @NotNull PsiFile file) { visit(file, fileIndex, psiManager); }
visitFile
249,073
void (@NotNull PsiFile file, @NotNull ProjectFileIndex fileIndex, @NotNull PsiManager psiManager) { final FileViewProvider viewProvider = file.getViewProvider(); if (viewProvider.getBaseLanguage() != file.getLanguage()) return; ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); final Vi...
visit
249,074
boolean () { return myTransitive > 0; }
isTransitive
249,075
int () { return myTransitive; }
getTransitiveBorder
249,076
FeatureUsageTracker () { return ApplicationManager.getApplication().getService(FeatureUsageTracker.class); }
getInstance
249,077
String () { return myName; }
getName
249,078
void (@NotNull String name) { myName = name; }
setName
249,079
boolean (Object o) { return this == o || o instanceof ProfileEx && myName.equals(((ProfileEx)o).myName); }
equals
249,080
int () { return myName.hashCode(); }
hashCode
249,081
int (@NotNull Object o) { return o instanceof ProfileEx ? getName().compareToIgnoreCase(((ProfileEx)o).getName()) : 0; }
compareTo
249,082
InspectionProjectProfileManager (@NotNull Project project) { return project.getService(InspectionProjectProfileManager.class); }
getInstance
249,083
InspectionProfile () { return getCurrentProfile(); }
getInspectionProfile
249,084
boolean (String shortName, @NotNull PsiElement element) { HighlightDisplayKey key = HighlightDisplayKey.find(shortName); if (key != null) { HighlightDisplayLevel errorLevel = getInstance(element.getProject()).getCurrentProfile().getErrorLevel(key, element); return HighlightDisplayLevel.DO_NOT_SHOW.equals(errorLevel); }...
isInformationLevel
249,085
InspectionProfileManager () { return ApplicationManager.getApplication().getService(InspectionProfileManager.class); }
getInstance
249,086
InspectionProfileManager (@NotNull Project project) { return InspectionProjectProfileManager.getInstance(project); }
getInstance
249,087
String (@NotNull Path file, @NotNull Element element) { String name = null; for (Element option : element.getChildren("option")) { if ("myName".equals(option.getAttributeValue("name"))) { name = option.getAttributeValue("value"); } } if (name == null) { name = element.getAttributeValue("profile_name"); } return name !=...
getProfileName
249,088
void () { }
dispose
249,089
void () { for (Iterator<Map.Entry<VirtualFile, MappingValue<T>>> it = myMappings.entrySet().iterator(); it.hasNext(); ) { Map.Entry<VirtualFile, MappingValue<T>> entry = it.next(); VirtualFile file = entry.getKey(); MappingValue<T> mapping = entry.getValue(); if (file == null) continue; if (mapping == null || !file.isV...
cleanup
249,090
T (@Nullable VirtualFile file) { for (VirtualFile cur = file; cur != null; cur = cur.getParent()) { T t = doGetImmediateMapping(cur); if (t != null) return t; } return null; }
getMappingForHierarchy
249,091
boolean (@NotNull VirtualFile file, @NotNull T mapping) { return false; }
isDefaultMapping
249,092
void (@NotNull Map<VirtualFile, T> mappings) { Collection<VirtualFile> oldFiles; synchronized (myMappings) { myDeferredMappings = null; oldFiles = new ArrayList<>(myMappings.keySet()); Set<VirtualFile> oldAndNewKeys = new HashSet<>(); oldAndNewKeys.addAll(myMappings.keySet()); oldAndNewKeys.addAll(mappings.keySet()); f...
setMappings
249,093
void (@Nullable VirtualFile file, @Nullable T value) { synchronized (myMappings) { ensureStateLoaded(); if (value == null) { myMappings.remove(file); } else { myMappings.put(file, MappingValue.known(value)); } } List<VirtualFile> files = ContainerUtil.createMaybeSingletonList(file); handleMappingChange(files, files, fa...
setMapping
249,094
void (Collection<? extends VirtualFile> files, Collection<? extends VirtualFile> oldFiles, boolean includeOpenFiles) { Project project = getProject(); FilePropertyPusher<T> pusher = getFilePropertyPusher(); if (project != null && pusher != null) { for (VirtualFile oldFile : oldFiles) { if (oldFile == null) continue; //...
handleMappingChange
249,095
Element () { synchronized (myMappings) { if (myDeferredMappings != null) { return PerFileMappingState.write(myDeferredMappings, getValueAttribute()); } cleanup(); Element element = new Element("x"); List<VirtualFile> files = new ArrayList<>(myMappings.keySet()); files.sort((o1, o2) -> { if (o1 == null || o2 == null) re...
getState
249,096
String () { return "value"; }
getValueAttribute
249,097
void (@NotNull Element element) { // read not under lock List<PerFileMappingState> list = PerFileMappingState.read(element, getValueAttribute()); synchronized (myMappings) { if (list.isEmpty()) { myMappings.clear(); myDeferredMappings = null; } else { myDeferredMappings = list; } } }
loadState
249,098
void () { synchronized (myMappings) { List<PerFileMappingState> state = myDeferredMappings; if (state == null) { return; } myDeferredMappings = null; Map<String, T> valuesMap = new HashMap<>(); for (T value : getAvailableValues()) { String key = value == null ? null : serialize(value); if (key != null) { valuesMap.put(...
ensureStateLoaded
249,099
void () { synchronized (myMappings) { myDeferredMappings = null; myMappings.clear(); } }
cleanupForNextTest