Exemplo n.º 1
0
        public Mitigation GetAllMitigationsForBuildAndFlaws(string buildIds, string[] flawIds)
        {
            var flaw_string = string.Join(",", flawIds);
            var xml         = _wrapper.GetMitigationInfo(buildIds, flaw_string);

            return(XmlParseHelper.Parse <Mitigation>(xml));
        }
        public MitigationInfoIssueType[] GetAllMitigationsForBuild(string buildId)
        {
            var mitgations = new List <MitigationInfoIssueType>();
            var flawIds    = GetFlaws(buildId).Select(x => x.issueid).ToArray();

            for (var i = 0; i < flawIds.Length; i += FLAW_BATCH_LIMIT)
            {
                var batch       = flawIds.Skip(i).Take(FLAW_BATCH_LIMIT);
                var flaw_string = string.Join(",", batch);
                var xml         = _wrapper.GetMitigationInfo(buildId, flaw_string);

                if (string.IsNullOrWhiteSpace(xml))
                {
                    continue;
                }

                var issueType         = XmlParseHelper.Parse <mitigationinfo>(xml);
                var issuesWithActions = issueType.issue.Where(x => x.mitigation_action != null && !x.mitigation_action.Any());
                mitgations.AddRange(issuesWithActions);
            }

            return(mitgations.ToArray());
        }