Codota Logo
Constants$Severity.name
Code IndexAdd Codota to your IDE (free)

How to use
name
method
in
org.sonar.scanner.protocol.Constants$Severity

Best Java code snippets using org.sonar.scanner.protocol.Constants$Severity.name (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: SonarSource/sonarqube

public NewAdHocRule(ScannerReport.AdHocRule ruleFromScannerReport) {
 Preconditions.checkArgument(isNotBlank(ruleFromScannerReport.getEngineId()), "'engine id' not expected to be null for an ad hoc rule");
 Preconditions.checkArgument(isNotBlank(ruleFromScannerReport.getRuleId()), "'rule id' not expected to be null for an ad hoc rule");
 Preconditions.checkArgument(isNotBlank(ruleFromScannerReport.getName()), "'name' not expected to be null for an ad hoc rule");
 Preconditions.checkArgument(ruleFromScannerReport.getSeverity() != Constants.Severity.UNSET_SEVERITY , "'severity' not expected to be null for an ad hoc rule");
 Preconditions.checkArgument(ruleFromScannerReport.getType() != ScannerReport.IssueType.UNSET, "'issue type' not expected to be null for an ad hoc rule");
 this.key = RuleKey.of(RuleKey.EXTERNAL_RULE_REPO_PREFIX + ruleFromScannerReport.getEngineId(), ruleFromScannerReport.getRuleId());
 this.engineId = ruleFromScannerReport.getEngineId();
 this.ruleId = ruleFromScannerReport.getRuleId();
 this.name = ruleFromScannerReport.getName();
 this.description = trimToNull(ruleFromScannerReport.getDescription());
 this.severity = ruleFromScannerReport.getSeverity().name();
 this.ruleType = RuleType.valueOf(ruleFromScannerReport.getType().name());
 this.hasDetails = true;
}
origin: SonarSource/sonarqube

@VisibleForTesting
protected void mergeMatched(Tracking<TrackedIssue, ServerIssueFromWs> result, Collection<TrackedIssue> mergeTo, Collection<TrackedIssue> rawIssues) {
 for (Map.Entry<TrackedIssue, ServerIssueFromWs> e : result.getMatchedRaws().entrySet()) {
  org.sonar.scanner.protocol.input.ScannerInput.ServerIssue dto = e.getValue().getDto();
  TrackedIssue tracked = e.getKey();
  // invariant fields
  tracked.setKey(dto.getKey());
  // non-persisted fields
  tracked.setNew(false);
  // fields to update with old values
  tracked.setResolution(dto.hasResolution() ? dto.getResolution() : null);
  tracked.setStatus(dto.getStatus());
  tracked.setAssignee(dto.hasAssigneeLogin() ? dto.getAssigneeLogin() : null);
  tracked.setCreationDate(new Date(dto.getCreationDate()));
  if (dto.getManualSeverity()) {
   // Severity overridden by user
   tracked.setSeverity(dto.getSeverity().name());
  }
  mergeTo.add(tracked);
 }
}
origin: SonarSource/sonarqube

 private static ActiveRule convert(ScannerReport.ActiveRule input, Rule rule) {
  RuleKey key = RuleKey.of(input.getRuleRepository(), input.getRuleKey());
  Map<String, String> params = new HashMap<>(input.getParamsByKeyMap());
  long updatedAt = input.getUpdatedAt();
  return new ActiveRule(key, input.getSeverity().name(), params, updatedAt == 0 ? input.getCreatedAt() : updatedAt, rule.getPluginKey(), emptyToNull(input.getQProfileKey()));
 }
}
origin: SonarSource/sonarqube

public static TrackedIssue toTrackedIssue(InputComponent component, ScannerReport.Issue rawIssue, @Nullable SourceHashHolder hashes) {
 RuleKey ruleKey = RuleKey.of(rawIssue.getRuleRepository(), rawIssue.getRuleKey());
 Preconditions.checkNotNull(component.key(), "Component key must be set");
 Preconditions.checkNotNull(ruleKey, "Rule key must be set");
 TrackedIssue issue = new TrackedIssue(hashes != null ? hashes.getHashedSource() : null);
 issue.setKey(Uuids.createFast());
 issue.setComponentKey(component.key());
 issue.setRuleKey(ruleKey);
 issue.setGap(rawIssue.getGap() != 0 ? rawIssue.getGap() : null);
 issue.setSeverity(rawIssue.getSeverity().name());
 issue.setMessage(StringUtils.trimToNull(rawIssue.getMsg()));
 issue.setResolution(null);
 issue.setStatus(Issue.STATUS_OPEN);
 issue.setNew(true);
 if (rawIssue.hasTextRange()) {
  TextRange r = rawIssue.getTextRange();
  issue.setStartLine(r.getStartLine());
  issue.setStartLineOffset(r.getStartOffset());
  issue.setEndLine(r.getEndLine());
  issue.setEndLineOffset(r.getEndOffset());
 }
 return issue;
}
origin: SonarSource/sonarqube

issue.setSeverity(reportExternalIssue.getSeverity().name());
origin: SonarSource/sonarqube

issue.setSeverity(reportIssue.getSeverity().name());
origin: SonarSource/sonarqube

public static TrackedIssue toTrackedIssue(ServerIssue serverIssue, String componentKey) {
 TrackedIssue issue = new TrackedIssue();
 issue.setKey(serverIssue.getKey());
 issue.setStatus(serverIssue.getStatus());
 issue.setResolution(serverIssue.hasResolution() ? serverIssue.getResolution() : null);
 issue.setMessage(serverIssue.hasMsg() ? serverIssue.getMsg() : null);
 issue.setStartLine(serverIssue.hasLine() ? serverIssue.getLine() : null);
 issue.setEndLine(serverIssue.hasLine() ? serverIssue.getLine() : null);
 issue.setSeverity(serverIssue.getSeverity().name());
 issue.setAssignee(serverIssue.hasAssigneeLogin() ? serverIssue.getAssigneeLogin() : null);
 // key in serverIssue might have branch, so don't use it
 issue.setComponentKey(componentKey);
 issue.setCreationDate(new Date(serverIssue.getCreationDate()));
 issue.setRuleKey(RuleKey.of(serverIssue.getRuleRepository(), serverIssue.getRuleKey()));
 issue.setNew(false);
 return issue;
}
origin: org.sonarsource.sonarqube/sonar-scanner-engine

@Override
public String severity() {
 return rawIssue.getSeverity().name();
}
origin: org.sonarsource.sonarqube/sonar-scanner-engine

public static TrackedIssue toTrackedIssue(ServerIssue serverIssue, String componentKey) {
 TrackedIssue issue = new TrackedIssue();
 issue.setKey(serverIssue.getKey());
 issue.setStatus(serverIssue.getStatus());
 issue.setResolution(serverIssue.hasResolution() ? serverIssue.getResolution() : null);
 issue.setMessage(serverIssue.hasMsg() ? serverIssue.getMsg() : null);
 issue.setStartLine(serverIssue.hasLine() ? serverIssue.getLine() : null);
 issue.setEndLine(serverIssue.hasLine() ? serverIssue.getLine() : null);
 issue.setSeverity(serverIssue.getSeverity().name());
 issue.setAssignee(serverIssue.hasAssigneeLogin() ? serverIssue.getAssigneeLogin() : null);
 // key in serverIssue might have branch, so don't use it
 issue.setComponentKey(componentKey);
 issue.setCreationDate(new Date(serverIssue.getCreationDate()));
 issue.setRuleKey(RuleKey.of(serverIssue.getRuleRepository(), serverIssue.getRuleKey()));
 issue.setNew(false);
 return issue;
}
origin: org.sonarsource.sonarqube/sonar-scanner-engine

@VisibleForTesting
protected void mergeMatched(Tracking<TrackedIssue, ServerIssueFromWs> result, Collection<TrackedIssue> mergeTo, Collection<TrackedIssue> rawIssues) {
 for (Map.Entry<TrackedIssue, ServerIssueFromWs> e : result.getMatchedRaws().entrySet()) {
  org.sonar.scanner.protocol.input.ScannerInput.ServerIssue dto = e.getValue().getDto();
  TrackedIssue tracked = e.getKey();
  // invariant fields
  tracked.setKey(dto.getKey());
  // non-persisted fields
  tracked.setNew(false);
  // fields to update with old values
  tracked.setResolution(dto.hasResolution() ? dto.getResolution() : null);
  tracked.setStatus(dto.getStatus());
  tracked.setAssignee(dto.hasAssigneeLogin() ? dto.getAssigneeLogin() : null);
  tracked.setCreationDate(new Date(dto.getCreationDate()));
  if (dto.getManualSeverity()) {
   // Severity overridden by user
   tracked.setSeverity(dto.getSeverity().name());
  }
  mergeTo.add(tracked);
 }
}
origin: org.sonarsource.sonarqube/sonar-scanner-engine

public static TrackedIssue toTrackedIssue(InputComponent component, ScannerReport.Issue rawIssue, @Nullable SourceHashHolder hashes) {
 RuleKey ruleKey = RuleKey.of(rawIssue.getRuleRepository(), rawIssue.getRuleKey());
 Preconditions.checkNotNull(component.key(), "Component key must be set");
 Preconditions.checkNotNull(ruleKey, "Rule key must be set");
 TrackedIssue issue = new TrackedIssue(hashes != null ? hashes.getHashedSource() : null);
 issue.setKey(Uuids.createFast());
 issue.setComponentKey(component.key());
 issue.setRuleKey(ruleKey);
 issue.setGap(rawIssue.getGap() != 0 ? rawIssue.getGap() : null);
 issue.setSeverity(rawIssue.getSeverity().name());
 issue.setMessage(StringUtils.trimToNull(rawIssue.getMsg()));
 issue.setResolution(null);
 issue.setStatus(Issue.STATUS_OPEN);
 issue.setNew(true);
 if (rawIssue.hasTextRange()) {
  TextRange r = rawIssue.getTextRange();
  issue.setStartLine(r.getStartLine());
  issue.setStartLineOffset(r.getStartOffset());
  issue.setEndLine(r.getEndLine());
  issue.setEndLineOffset(r.getEndOffset());
 }
 return issue;
}
origin: SonarSource/sonarlint-core

public Sonarlint.ServerIssue toStorageIssue(ScannerInput.ServerIssue issue, Sonarlint.ProjectConfiguration projectConfiguration) {
 String sqPath = fileKeyToSqPath(projectConfiguration, issue.getModuleKey(), issue.getPath());
 Sonarlint.ServerIssue.Builder builder = Sonarlint.ServerIssue.newBuilder()
  .setAssigneeLogin(issue.getAssigneeLogin())
  .setChecksum(issue.getChecksum())
  .setCreationDate(issue.getCreationDate())
  .setKey(issue.getKey())
  .setLine(issue.getLine())
  .setManualSeverity(issue.getManualSeverity())
  .setModuleKey(issue.getModuleKey())
  .setMsg(issue.getMsg())
  .setPath(sqPath)
  .setResolution(issue.getResolution())
  .setRuleKey(issue.getRuleKey())
  .setRuleRepository(issue.getRuleRepository())
  .setSeverity(issue.getSeverity().name())
  .setStatus(issue.getStatus());
 if (issue.hasType()) {
  // type was added recently
  builder.setType(issue.getType());
 }
 return builder.build();
}
origin: SonarSource/sonarqube

@Override
public String severity() {
 return rawIssue.getSeverity().name();
}
origin: org.sonarsource.sonarqube/sonar-server

issue.setSeverity(reportIssue.getSeverity().name());
origin: org.sonarsource.sonarqube/sonar-server

issue.setSeverity(reportIssue.getSeverity().name());
origin: org.sonarsource.sonarqube/sonar-server

 private static ActiveRule convert(ScannerReport.ActiveRule input, Rule rule) {
  RuleKey key = RuleKey.of(input.getRuleRepository(), input.getRuleKey());
  Map<String, String> params = new HashMap<>(input.getParamsByKeyMap());
  return new ActiveRule(key, input.getSeverity().name(), params, input.getCreatedAt(), rule.getPluginKey());
 }
}
org.sonar.scanner.protocolConstants$Severityname

Popular methods of Constants$Severity

  • valueOf

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • getSystemService (Context)
  • findViewById (Activity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now