Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Result" /> class from the supplied values.
 /// </summary>
 /// <param name="ruleId">
 /// An initialization value for the <see cref="P: RuleId" /> property.
 /// </param>
 /// <param name="level">
 /// An initialization value for the <see cref="P: Level" /> property.
 /// </param>
 /// <param name="message">
 /// An initialization value for the <see cref="P: Message" /> property.
 /// </param>
 /// <param name="ruleMessageId">
 /// An initialization value for the <see cref="P: RuleMessageId" /> property.
 /// </param>
 /// <param name="analysisTarget">
 /// An initialization value for the <see cref="P: AnalysisTarget" /> property.
 /// </param>
 /// <param name="locations">
 /// An initialization value for the <see cref="P: Locations" /> property.
 /// </param>
 /// <param name="instanceGuid">
 /// An initialization value for the <see cref="P: InstanceGuid" /> property.
 /// </param>
 /// <param name="correlationGuid">
 /// An initialization value for the <see cref="P: CorrelationGuid" /> property.
 /// </param>
 /// <param name="partialFingerprints">
 /// An initialization value for the <see cref="P: PartialFingerprints" /> property.
 /// </param>
 /// <param name="fingerprints">
 /// An initialization value for the <see cref="P: Fingerprints" /> property.
 /// </param>
 /// <param name="stacks">
 /// An initialization value for the <see cref="P: Stacks" /> property.
 /// </param>
 /// <param name="codeFlows">
 /// An initialization value for the <see cref="P: CodeFlows" /> property.
 /// </param>
 /// <param name="graphs">
 /// An initialization value for the <see cref="P: Graphs" /> property.
 /// </param>
 /// <param name="graphTraversals">
 /// An initialization value for the <see cref="P: GraphTraversals" /> property.
 /// </param>
 /// <param name="relatedLocations">
 /// An initialization value for the <see cref="P: RelatedLocations" /> property.
 /// </param>
 /// <param name="suppressionStates">
 /// An initialization value for the <see cref="P: SuppressionStates" /> property.
 /// </param>
 /// <param name="baselineState">
 /// An initialization value for the <see cref="P: BaselineState" /> property.
 /// </param>
 /// <param name="attachments">
 /// An initialization value for the <see cref="P: Attachments" /> property.
 /// </param>
 /// <param name="workItemUris">
 /// An initialization value for the <see cref="P: WorkItemUris" /> property.
 /// </param>
 /// <param name="conversionProvenance">
 /// An initialization value for the <see cref="P: ConversionProvenance" /> property.
 /// </param>
 /// <param name="fixes">
 /// An initialization value for the <see cref="P: Fixes" /> property.
 /// </param>
 /// <param name="properties">
 /// An initialization value for the <see cref="P: Properties" /> property.
 /// </param>
 public Result(string ruleId, ResultLevel level, Message message, string ruleMessageId, FileLocation analysisTarget, IEnumerable <Location> locations, string instanceGuid, string correlationGuid, IDictionary <string, string> partialFingerprints, IDictionary <string, string> fingerprints, IEnumerable <Stack> stacks, IEnumerable <CodeFlow> codeFlows, IEnumerable <Graph> graphs, IEnumerable <GraphTraversal> graphTraversals, IEnumerable <Location> relatedLocations, SuppressionStates suppressionStates, BaselineState baselineState, IEnumerable <Attachment> attachments, IEnumerable <Uri> workItemUris, IEnumerable <PhysicalLocation> conversionProvenance, IEnumerable <Fix> fixes, IDictionary <string, SerializedPropertyInfo> properties)
 {
     Init(ruleId, level, message, ruleMessageId, analysisTarget, locations, instanceGuid, correlationGuid, partialFingerprints, fingerprints, stacks, codeFlows, graphs, graphTraversals, relatedLocations, suppressionStates, baselineState, attachments, workItemUris, conversionProvenance, fixes, properties);
 }
Example #2
0
        private void Init(string ruleId, ResultLevel level, Message message, string ruleMessageId, FileLocation analysisTarget, IEnumerable <Location> locations, string instanceGuid, string correlationGuid, IDictionary <string, string> partialFingerprints, IDictionary <string, string> fingerprints, IEnumerable <Stack> stacks, IEnumerable <CodeFlow> codeFlows, IEnumerable <Graph> graphs, IEnumerable <GraphTraversal> graphTraversals, IEnumerable <Location> relatedLocations, SuppressionStates suppressionStates, BaselineState baselineState, IEnumerable <Attachment> attachments, IEnumerable <Uri> workItemUris, IEnumerable <PhysicalLocation> conversionProvenance, IEnumerable <Fix> fixes, IDictionary <string, SerializedPropertyInfo> properties)
        {
            RuleId = ruleId;
            Level  = level;
            if (message != null)
            {
                Message = new Message(message);
            }

            RuleMessageId = ruleMessageId;
            if (analysisTarget != null)
            {
                AnalysisTarget = new FileLocation(analysisTarget);
            }

            if (locations != null)
            {
                var destination_0 = new List <Location>();
                foreach (var value_0 in locations)
                {
                    if (value_0 == null)
                    {
                        destination_0.Add(null);
                    }
                    else
                    {
                        destination_0.Add(new Location(value_0));
                    }
                }

                Locations = destination_0;
            }

            InstanceGuid    = instanceGuid;
            CorrelationGuid = correlationGuid;
            if (partialFingerprints != null)
            {
                PartialFingerprints = new Dictionary <string, string>(partialFingerprints);
            }

            if (fingerprints != null)
            {
                Fingerprints = new Dictionary <string, string>(fingerprints);
            }

            if (stacks != null)
            {
                var destination_1 = new List <Stack>();
                foreach (var value_1 in stacks)
                {
                    if (value_1 == null)
                    {
                        destination_1.Add(null);
                    }
                    else
                    {
                        destination_1.Add(new Stack(value_1));
                    }
                }

                Stacks = destination_1;
            }

            if (codeFlows != null)
            {
                var destination_2 = new List <CodeFlow>();
                foreach (var value_2 in codeFlows)
                {
                    if (value_2 == null)
                    {
                        destination_2.Add(null);
                    }
                    else
                    {
                        destination_2.Add(new CodeFlow(value_2));
                    }
                }

                CodeFlows = destination_2;
            }

            if (graphs != null)
            {
                var destination_3 = new List <Graph>();
                foreach (var value_3 in graphs)
                {
                    if (value_3 == null)
                    {
                        destination_3.Add(null);
                    }
                    else
                    {
                        destination_3.Add(new Graph(value_3));
                    }
                }

                Graphs = destination_3;
            }

            if (graphTraversals != null)
            {
                var destination_4 = new List <GraphTraversal>();
                foreach (var value_4 in graphTraversals)
                {
                    if (value_4 == null)
                    {
                        destination_4.Add(null);
                    }
                    else
                    {
                        destination_4.Add(new GraphTraversal(value_4));
                    }
                }

                GraphTraversals = destination_4;
            }

            if (relatedLocations != null)
            {
                var destination_5 = new List <Location>();
                foreach (var value_5 in relatedLocations)
                {
                    if (value_5 == null)
                    {
                        destination_5.Add(null);
                    }
                    else
                    {
                        destination_5.Add(new Location(value_5));
                    }
                }

                RelatedLocations = destination_5;
            }

            SuppressionStates = suppressionStates;
            BaselineState     = baselineState;
            if (attachments != null)
            {
                var destination_6 = new List <Attachment>();
                foreach (var value_6 in attachments)
                {
                    if (value_6 == null)
                    {
                        destination_6.Add(null);
                    }
                    else
                    {
                        destination_6.Add(new Attachment(value_6));
                    }
                }

                Attachments = destination_6;
            }

            if (workItemUris != null)
            {
                var destination_7 = new List <Uri>();
                foreach (var value_7 in workItemUris)
                {
                    destination_7.Add(value_7);
                }

                WorkItemUris = destination_7;
            }

            if (conversionProvenance != null)
            {
                var destination_8 = new List <PhysicalLocation>();
                foreach (var value_8 in conversionProvenance)
                {
                    if (value_8 == null)
                    {
                        destination_8.Add(null);
                    }
                    else
                    {
                        destination_8.Add(new PhysicalLocation(value_8));
                    }
                }

                ConversionProvenance = destination_8;
            }

            if (fixes != null)
            {
                var destination_9 = new List <Fix>();
                foreach (var value_9 in fixes)
                {
                    if (value_9 == null)
                    {
                        destination_9.Add(null);
                    }
                    else
                    {
                        destination_9.Add(new Fix(value_9));
                    }
                }

                Fixes = destination_9;
            }

            if (properties != null)
            {
                Properties = new Dictionary <string, SerializedPropertyInfo>(properties);
            }
        }
Example #3
0

        
Example #4
0

        
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FileData" /> class from the supplied values.
 /// </summary>
 /// <param name="fileLocation">
 /// An initialization value for the <see cref="P: FileLocation" /> property.
 /// </param>
 /// <param name="parentKey">
 /// An initialization value for the <see cref="P: ParentKey" /> property.
 /// </param>
 /// <param name="offset">
 /// An initialization value for the <see cref="P: Offset" /> property.
 /// </param>
 /// <param name="length">
 /// An initialization value for the <see cref="P: Length" /> property.
 /// </param>
 /// <param name="roles">
 /// An initialization value for the <see cref="P: Roles" /> property.
 /// </param>
 /// <param name="mimeType">
 /// An initialization value for the <see cref="P: MimeType" /> property.
 /// </param>
 /// <param name="contents">
 /// An initialization value for the <see cref="P: Contents" /> property.
 /// </param>
 /// <param name="encoding">
 /// An initialization value for the <see cref="P: Encoding" /> property.
 /// </param>
 /// <param name="hashes">
 /// An initialization value for the <see cref="P: Hashes" /> property.
 /// </param>
 /// <param name="lastModifiedTime">
 /// An initialization value for the <see cref="P: LastModifiedTime" /> property.
 /// </param>
 /// <param name="properties">
 /// An initialization value for the <see cref="P: Properties" /> property.
 /// </param>
 public FileData(FileLocation fileLocation, string parentKey, int offset, int length, FileRoles roles, string mimeType, FileContent contents, string encoding, IEnumerable <Hash> hashes, DateTime lastModifiedTime, IDictionary <string, SerializedPropertyInfo> properties)
 {
     Init(fileLocation, parentKey, offset, length, roles, mimeType, contents, encoding, hashes, lastModifiedTime, properties);
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Attachment" /> class from the supplied values.
 /// </summary>
 /// <param name="description">
 /// An initialization value for the <see cref="P: Description" /> property.
 /// </param>
 /// <param name="fileLocation">
 /// An initialization value for the <see cref="P: FileLocation" /> property.
 /// </param>
 /// <param name="regions">
 /// An initialization value for the <see cref="P: Regions" /> property.
 /// </param>
 /// <param name="rectangles">
 /// An initialization value for the <see cref="P: Rectangles" /> property.
 /// </param>
 public Attachment(Message description, FileLocation fileLocation, IEnumerable <Region> regions, IEnumerable <Rectangle> rectangles)
 {
     Init(description, fileLocation, regions, rectangles);
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FileChange" /> class from the supplied values.
 /// </summary>
 /// <param name="fileLocation">
 /// An initialization value for the <see cref="P: FileLocation" /> property.
 /// </param>
 /// <param name="replacements">
 /// An initialization value for the <see cref="P: Replacements" /> property.
 /// </param>
 public FileChange(FileLocation fileLocation, IEnumerable <Replacement> replacements)
 {
     Init(fileLocation, replacements);
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PhysicalLocation" /> class from the supplied values.
 /// </summary>
 /// <param name="id">
 /// An initialization value for the <see cref="P: Id" /> property.
 /// </param>
 /// <param name="fileLocation">
 /// An initialization value for the <see cref="P: FileLocation" /> property.
 /// </param>
 /// <param name="region">
 /// An initialization value for the <see cref="P: Region" /> property.
 /// </param>
 /// <param name="contextRegion">
 /// An initialization value for the <see cref="P: ContextRegion" /> property.
 /// </param>
 public PhysicalLocation(int id, FileLocation fileLocation, Region region, Region contextRegion)
 {
     Init(id, fileLocation, region, contextRegion);
 }
Example #9
0
 public bool ValueEquals(FileLocation other) => ValueComparer.Equals(this, other);
Example #10
0
        private void Init(string id, Message name, Message shortDescription, Message fullDescription, IDictionary <string, string> messageStrings, IDictionary <string, string> richMessageStrings, RuleConfiguration configuration, FileLocation helpLocation, Message help, IDictionary <string, SerializedPropertyInfo> properties)
        {
            Id = id;
            if (name != null)
            {
                Name = new Message(name);
            }

            if (shortDescription != null)
            {
                ShortDescription = new Message(shortDescription);
            }

            if (fullDescription != null)
            {
                FullDescription = new Message(fullDescription);
            }

            if (messageStrings != null)
            {
                MessageStrings = new Dictionary <string, string>(messageStrings);
            }

            if (richMessageStrings != null)
            {
                RichMessageStrings = new Dictionary <string, string>(richMessageStrings);
            }

            if (configuration != null)
            {
                Configuration = new RuleConfiguration(configuration);
            }

            if (helpLocation != null)
            {
                HelpLocation = new FileLocation(helpLocation);
            }

            if (help != null)
            {
                Help = new Message(help);
            }

            if (properties != null)
            {
                Properties = new Dictionary <string, SerializedPropertyInfo>(properties);
            }
        }
Example #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Rule" /> class from the supplied values.
 /// </summary>
 /// <param name="id">
 /// An initialization value for the <see cref="P: Id" /> property.
 /// </param>
 /// <param name="name">
 /// An initialization value for the <see cref="P: Name" /> property.
 /// </param>
 /// <param name="shortDescription">
 /// An initialization value for the <see cref="P: ShortDescription" /> property.
 /// </param>
 /// <param name="fullDescription">
 /// An initialization value for the <see cref="P: FullDescription" /> property.
 /// </param>
 /// <param name="messageStrings">
 /// An initialization value for the <see cref="P: MessageStrings" /> property.
 /// </param>
 /// <param name="richMessageStrings">
 /// An initialization value for the <see cref="P: RichMessageStrings" /> property.
 /// </param>
 /// <param name="configuration">
 /// An initialization value for the <see cref="P: Configuration" /> property.
 /// </param>
 /// <param name="helpLocation">
 /// An initialization value for the <see cref="P: HelpLocation" /> property.
 /// </param>
 /// <param name="help">
 /// An initialization value for the <see cref="P: Help" /> property.
 /// </param>
 /// <param name="properties">
 /// An initialization value for the <see cref="P: Properties" /> property.
 /// </param>
 public Rule(string id, Message name, Message shortDescription, Message fullDescription, IDictionary <string, string> messageStrings, IDictionary <string, string> richMessageStrings, RuleConfiguration configuration, FileLocation helpLocation, Message help, IDictionary <string, SerializedPropertyInfo> properties)
 {
     Init(id, name, shortDescription, fullDescription, messageStrings, richMessageStrings, configuration, helpLocation, help, properties);
 }
Example #12
0
        private void Init(FileLocation conversion, FileLocation files, FileLocation graphs, IEnumerable <FileLocation> invocations, FileLocation logicalLocations, FileLocation resources, IEnumerable <FileLocation> results)
        {
            if (conversion != null)
            {
                Conversion = new FileLocation(conversion);
            }

            if (files != null)
            {
                Files = new FileLocation(files);
            }

            if (graphs != null)
            {
                Graphs = new FileLocation(graphs);
            }

            if (invocations != null)
            {
                var destination_0 = new List <FileLocation>();
                foreach (var value_0 in invocations)
                {
                    if (value_0 == null)
                    {
                        destination_0.Add(null);
                    }
                    else
                    {
                        destination_0.Add(new FileLocation(value_0));
                    }
                }

                Invocations = destination_0;
            }

            if (logicalLocations != null)
            {
                LogicalLocations = new FileLocation(logicalLocations);
            }

            if (resources != null)
            {
                Resources = new FileLocation(resources);
            }

            if (results != null)
            {
                var destination_1 = new List <FileLocation>();
                foreach (var value_1 in results)
                {
                    if (value_1 == null)
                    {
                        destination_1.Add(null);
                    }
                    else
                    {
                        destination_1.Add(new FileLocation(value_1));
                    }
                }

                Results = destination_1;
            }
        }
Example #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExternalFiles" /> class from the supplied values.
 /// </summary>
 /// <param name="conversion">
 /// An initialization value for the <see cref="P: Conversion" /> property.
 /// </param>
 /// <param name="files">
 /// An initialization value for the <see cref="P: Files" /> property.
 /// </param>
 /// <param name="graphs">
 /// An initialization value for the <see cref="P: Graphs" /> property.
 /// </param>
 /// <param name="invocations">
 /// An initialization value for the <see cref="P: Invocations" /> property.
 /// </param>
 /// <param name="logicalLocations">
 /// An initialization value for the <see cref="P: LogicalLocations" /> property.
 /// </param>
 /// <param name="resources">
 /// An initialization value for the <see cref="P: Resources" /> property.
 /// </param>
 /// <param name="results">
 /// An initialization value for the <see cref="P: Results" /> property.
 /// </param>
 public ExternalFiles(FileLocation conversion, FileLocation files, FileLocation graphs, IEnumerable <FileLocation> invocations, FileLocation logicalLocations, FileLocation resources, IEnumerable <FileLocation> results)
 {
     Init(conversion, files, graphs, invocations, logicalLocations, resources, results);
 }