public OperationResult(string message, IssueSeverity severity) { Issues = new List <Issue> { new Issue(message, severity) }; }
public Issue(string source, string message, string details, IssueSeverity severity) { this.source = source; this.summary = message; this.details = details; this.severity = severity; }
public static string GetHtmlColor(IssueSeverity severity) { Init(); Color32 color32 = GetColor(severity); return(color32.r.ToString("x2") + color32.g.ToString("x2") + color32.b.ToString("x2") + color32.a.ToString("x2")); }
private static void ValidateSeverityEnum(IssueSeverity severity) { if (!Enum.IsDefined(typeof(IssueSeverity), severity)) { throw new InvalidIssueSeverityException(); } }
public Issue(string source, string message, string details, IssueSeverity severity) { this.source = source; this.summary = message; this.details = details; this.severity = severity; }
public static bool TryParse(string value, out IssueSeverity result) { result = default(IssueSeverity); if (value == "fatal") { result = IssueSeverity.Fatal; } else if (value == "error") { result = IssueSeverity.Error; } else if (value == "warning") { result = IssueSeverity.Warning; } else if (value == "information") { result = IssueSeverity.Information; } else { return(false); } return(true); }
private IAnalysisIssue ToAnalysisIssue(Message cFamilyIssue, string sqLanguage, IssueSeverity defaultSeverity, IssueType defaultType, IReadOnlyList <IAnalysisIssueFlow> flows, IDictionary <string, string> fileContents) { return(new AnalysisIssue ( ruleKey: sqLanguage + ":" + cFamilyIssue.RuleKey, severity: Convert(defaultSeverity), type: Convert(defaultType), filePath: cFamilyIssue.Filename, message: cFamilyIssue.Text, lineHash: CalculateLineHash(cFamilyIssue, fileContents), startLine: cFamilyIssue.Line, endLine: cFamilyIssue.EndLine, // We don't care about the columns in the special case EndLine=0 startLineOffset: cFamilyIssue.EndLine == 0 ? 0 : cFamilyIssue.Column - 1, endLineOffset: cFamilyIssue.EndLine == 0 ? 0 : cFamilyIssue.EndColumn - 1, flows: flows )); }
public Issue(string source, string message, string details, IssueSeverity severity) { Source = source; Summary = message; Details = details; Severity = severity; }
internal ModelError(IssueSeverity severity, object item, string message) { Debug.Assert(!String.IsNullOrWhiteSpace(message)); Severity = severity; Item = item; Message = message; }
internal DataError(IssueSeverity severity, ValueDescriptor item, string message) { Debug.Assert(!String.IsNullOrWhiteSpace(message)); Severity = severity; Item = item; Message = message; }
public Issue(string name, string description, IssueSeverity severity, IssueCategory category, TreeItem treeItem) { Severity = severity; Description = description; TreeItem = treeItem; Category = category; Name = name; }
public void SetSeverity(IssueSeverity severity, int fixType = 0, string description = "") { var update = !Severity.HasValue || Severity.Value != severity || Description != description; if (update) { FixType = fixType; Severity = severity; Description = description; } }
public DummyCFamilyRulesConfig AddRule(string partialRuleKey, IssueSeverity issueSeverity, bool isActive, Dictionary <string, string> parameters) { ruleKeyToActiveMap[partialRuleKey] = isActive; RulesMetadata[partialRuleKey] = new RuleMetadata { DefaultSeverity = issueSeverity }; if (parameters != null) { RulesParameters[partialRuleKey] = parameters; } return(this); }
public IssueRecord(GameObject gameObject, int gameObjectIndex, string path, IssueType type) { this.gameObject = EditorTools.GetFullTransformPath(gameObject.transform); this.gameObjectIndex = gameObjectIndex; if (path == null) { path = AssetDatabase.GetAssetPath(gameObject); source = IssueSource.Prefab; } this.path = path; this.type = type; severity = issueTypeSeverity[type]; }
public string GetSeverityImage(IssueSeverity severity) { switch (severity) { case IssueSeverity.Lowest: return("severity_1.png"); case IssueSeverity.Low: return("severity_2.png"); case IssueSeverity.Medium: return("severity_3.png"); case IssueSeverity.High: return("severity_4.png"); case IssueSeverity.Highest: return("severity_5.png"); } return(""); }
private void AddIssue(RawCalf calf, string issueDescription, IssueSeverity issueSeverity = IssueSeverity.Fatal) { switch (issueSeverity) { case IssueSeverity.Fatal: IssueList.Add(string.Format("FATAL. Id:{0} - {1}", calf.HerdtraxAnimalId, issueDescription)); break; case IssueSeverity.Warn: IssueList.Add(string.Format("WARNING. Id:{0} - {1}", calf.HerdtraxAnimalId, issueDescription)); break; case IssueSeverity.Info: IssueList.Add(string.Format("Id:{0} - {1}", calf.HerdtraxAnimalId, issueDescription)); break; } }
/// <summary> /// Called on IssuesChanged event fired from LoggerService /// </summary> /// <param name="sender"></param> /// <param name="severity"></param> private void IssuesChanged(object sender, IssueSeverity severity) { switch (severity) { case IssueSeverity.Error: ErrorCount++; break; case IssueSeverity.Warning: WarningCount++; break; case IssueSeverity.Message: MessageCount++; break; } _uiContext.Post(o => IssuesList.Refresh(), null); }
public static string ToString(IssueSeverity value) { if (value == IssueSeverity.Error) { return("error"); } else if (value == IssueSeverity.Warning) { return("warning"); } else if (value == IssueSeverity.Information) { return("information"); } else { throw new ArgumentException("Unrecognized IssueSeverity value: " + value.ToString()); } }
public bool IncludeItem(IssueModel item) { IssueStatus status = item.Status; if (status == IssueStatus.Unresolved && ShowUnresolved == false) { return(false); } if (status == IssueStatus.InProgress && ShowInProgress == false) { return(false); } if (status == IssueStatus.Done && ShowResolved == false) { return(false); } IssueSeverity severity = item.Severity; if (severity == IssueSeverity.Lowest && ShowSeverityLowest == false) { return(false); } if (severity == IssueSeverity.Low && ShowSeverityLow == false) { return(false); } if (severity == IssueSeverity.Medium && ShowSeverityMedium == false) { return(false); } if (severity == IssueSeverity.High && ShowSeverityHigh == false) { return(false); } if (severity == IssueSeverity.Highest && ShowSeverityHighest == false) { return(false); } return(true); }
/// <summary> /// Converts from the CFamily issue severity enum to the standard AnalysisIssueSeverity /// </summary> internal /* for testing */ static AnalysisIssueSeverity Convert(IssueSeverity issueSeverity) { switch (issueSeverity) { case IssueSeverity.Blocker: return(AnalysisIssueSeverity.Blocker); case IssueSeverity.Critical: return(AnalysisIssueSeverity.Critical); case IssueSeverity.Info: return(AnalysisIssueSeverity.Info); case IssueSeverity.Major: return(AnalysisIssueSeverity.Major); case IssueSeverity.Minor: return(AnalysisIssueSeverity.Minor); default: throw new ArgumentOutOfRangeException(nameof(issueSeverity)); } }
public Issue(string message, IssueSeverity severity) { Summary = message; Severity = severity; }
public static bool TryParse(string value, out IssueSeverity result) { result = default(IssueSeverity); if( value=="fatal") result = IssueSeverity.Fatal; else if( value=="error") result = IssueSeverity.Error; else if( value=="warning") result = IssueSeverity.Warning; else if( value=="information") result = IssueSeverity.Information; else return false; return true; }
public Issue(IssueSeverity severity, string description, string context) { Severity = severity; Description = description; Context = context; }
public void ConvertFromIssueSeverity(IssueSeverity cfamilySeverity, AnalysisIssueSeverity analysisIssueSeverity) { CFamilyIssueToAnalysisIssueConverter.Convert(cfamilySeverity).Should().Be(analysisIssueSeverity); }
public Issue(string message, IssueSeverity severity) { this.summary = message; this.severity = severity; }
private Validation(string message, IssueSeverity severity) { Message = message; Severity = severity; }
public Issue(string message, IssueSeverity severity) { this.summary = message; this.severity = severity; }
public IssueSeverityModel(string name, IssueSeverity severity) { Name = name; Severity = severity; }
public static Color32 GetColor(IssueSeverity severity) { Init(); return(EditorGUIUtility.isProSkin ? severityColorsDarkSkin[severity] : severityColorsLightSkin[severity]); }
public DummyCFamilyRulesConfig AddRule(string partialRuleKey, IssueSeverity issueSeverity, bool isActive) { return(AddRule(partialRuleKey, issueSeverity, isActive, null)); }
public static string ToString(IssueSeverity value) { if( value==IssueSeverity.Fatal ) return "fatal"; else if( value==IssueSeverity.Error ) return "error"; else if( value==IssueSeverity.Warning ) return "warning"; else if( value==IssueSeverity.Information ) return "information"; else throw new ArgumentException("Unrecognized IssueSeverity value: " + value.ToString()); }
public Issue(string message, IssueSeverity severity) { Message = message; this.severity = severity; }
private void AssertIssue(Issue result, string expectedCategory, string expectedDescription, string expectedUri, string expectedMessage, string expectedName, IssueSeverity expectedSeverity, string expectedFilePath = null, uint?expectedLine = null) { Assert.Equal(expectedCategory, result.Category); Assert.Equal(expectedDescription, result.Description); Assert.Equal(expectedFilePath, result.FilePath); Assert.Equal(expectedUri, result.HelpUri.AbsoluteUri); Assert.Equal(expectedLine, result.Line); Assert.Equal(expectedMessage, result.Message); Assert.Equal(expectedName, result.Name); Assert.Null(result.Offset); Assert.Null(result.Project); Assert.Equal(expectedSeverity, result.Severity); Assert.Equal("FxCop", result.Source); }