Пример #1
0
 public void SetWeight(IssueSeverityType severity, int complexity, bool isAutomateFixAllowed)
 {
     IssueWeight = new IssueWeight
     {
         Severity             = severity,
         Complexity           = complexity,
         IsAutomateFixAllowed = isAutomateFixAllowed
     };
 }
Пример #2
0
        public void Update(int issueId, string title, string content, IssueSeverityType severity, IssueStateType state)
        {
            var issue = this.issues.GetById(issueId);
            issue.Title = title;
            issue.Content = content;
            issue.Severity = severity;
            issue.State = state;

            this.issues.SaveChanges();
        }
Пример #3
0
        /// <summary>
        /// Translate severity code
        /// </summary>
        public static CV <SeverityObservation> TranslateSeverityCode(IssueSeverityType issueSeverityType)
        {
            switch (issueSeverityType)
            {
            case IssueSeverityType.High:
                return(SeverityObservation.High);

            default:
                return(new CV <SeverityObservation>()
                {
                    NullFlavor = MARC.Everest.DataTypes.NullFlavor.Other, CodeSystem = "2.16.840.1.113883.5.1063", OriginalText = issueSeverityType.ToString()
                });
            }
        }
Пример #4
0
        public void Add(IssueSeverityType type, string text, object tag)
        {
            if (type != IssueSeverityType.None)
            {
                // Check if ParentNode has an Application, IssueObjectType and IssueObjectId defined or
                // it's not possible to add to the IssueList. Give an exception!
                if (ParentNode.Application == null ||
                    ParentNode.IssueObjectType == null ||
                    ParentNode.IssueObjectId == null)
                {
                    throw new Exception("You may not create any Issues to a IssueNode that doesn't have Application, IssueObjectType and IssueObjectId set!");
                }

                // Check if issue exist already
                Issue currentIssue = analyzeService.FindIssue(ParentNode.Application.Id, (IssueObjectType)ParentNode.IssueObjectType, ParentNode.IssueObjectId, GetTitle(), text);

                if (currentIssue != null)
                {
                    // Set the tag and the severity type
                    currentIssue.Tag      = tag;
                    currentIssue.Severity = type;

                    // Save Issue
                    analyzeService.SaveOrUpdateIssue(currentIssue);
                }
                else
                {
                    // Create the new Issue
                    currentIssue             = new Issue();
                    currentIssue.Application = ParentNode.Application;
                    currentIssue.ObjectType  = (IssueObjectType)ParentNode.IssueObjectType;
                    currentIssue.ObjectId    = ParentNode.IssueObjectId;
                    currentIssue.Severity    = type;
                    currentIssue.Tag         = tag;
                    currentIssue.Text        = text;
                    currentIssue.Title       = GetTitle();
                    currentIssue.Hidden      = false;

                    // Save the Issue
                    analyzeService.SaveOrUpdateIssue(currentIssue);
                }

                // Add the found or created issue to the list.
                base.Add(currentIssue);
            }
        }
Пример #5
0
        public static string GetDescription(IssueSeverityType severity)
        {
            switch (severity)
            {
            case IssueSeverityType.Hint:
                return("The issue complexify component to much (surface, edge, trim, join edges, join surfaces)");

            case IssueSeverityType.Suggestion:
                return("The issue connects faces in inconsistent way, so meshing or texturing can have artifacts");

            case IssueSeverityType.Warning:
                return("The issue deforms face or curve (zigzags, kinks, edge-trim mismatch)");

            case IssueSeverityType.Error:
                return("The issue makes brep invalid");
            }
            return("IssueSeverityTypeManager.GetCaption");
        }
Пример #6
0
        public Issue Create(string title, string content, IssueSeverityType severity, int packageId, string authorId)
        {
            var newIssue = new Issue()
            {
                Title = title,
                Content = content,
                Severity = severity,
                State = IssueStateType.Opened,
                OpenedOn = DateTime.UtcNow,
                AuthorId = authorId,
                PackageId = packageId
            };

            this.issues.Add(newIssue);
            this.issues.SaveChanges();

            return newIssue;
        }
Пример #7
0
 /// <summary>
 /// Issue exception
 /// </summary>
 public IssueException(IssueType type, ManagementType mitigation, IssuePriorityType priority, IssueSeverityType severity, String text) : this(
         new DetectedIssue()
 {
     Type = type,
     MitigatedBy = mitigation,
     Priority = priority,
     Severity = severity,
     Text = text
 })
 {
 }