コード例 #1
0
        public void FortifyFprStrings_ContainsCorrectStrings()
        {
            var nameTable = new NameTable();
            var uut       = new FortifyFprStrings(nameTable);

            Assert.Same(nameTable.Add("CreatedTS"), uut.CreatedTimestamp);
            Assert.Same(nameTable.Add("date"), uut.DateAttribute);
            Assert.Same(nameTable.Add("time"), uut.TimeAttribute);
            Assert.Same(nameTable.Add("UUID"), uut.Uuid);
            Assert.Same(nameTable.Add("Build"), uut.Build);
            Assert.Same(nameTable.Add("BuildID"), uut.BuildId);
            Assert.Same(nameTable.Add("SourceFiles"), uut.SourceFiles);
            Assert.Same(nameTable.Add("File"), uut.File);
            Assert.Same(nameTable.Add("size"), uut.SizeAttribute);
            Assert.Same(nameTable.Add("type"), uut.TypeAttribute);
            Assert.Same(nameTable.Add("encoding"), uut.EncodingAttribute);
            Assert.Same(nameTable.Add("Name"), uut.Name);
            Assert.Same(nameTable.Add("Vulnerabilities"), uut.Vulnerabilities);
            Assert.Same(nameTable.Add("Vulnerability"), uut.Vulnerability);
            Assert.Same(nameTable.Add("ClassID"), uut.ClassId);
            Assert.Same(nameTable.Add("AnalysisInfo"), uut.AnalysisInfo);
            Assert.Same(nameTable.Add("ReplacementDefinitions"), uut.ReplacementDefinitions);
            Assert.Same(nameTable.Add("Def"), uut.Def);
            Assert.Same(nameTable.Add("key"), uut.KeyAttribute);
            Assert.Same(nameTable.Add("value"), uut.ValueAttribute);
            Assert.Same(nameTable.Add("Trace"), uut.Trace);
            Assert.Same(nameTable.Add("Entry"), uut.Entry);
            Assert.Same(nameTable.Add("NodeRef"), uut.NodeRef);
            Assert.Same(nameTable.Add("label"), uut.LabelAttribute);
            Assert.Same(nameTable.Add("SourceLocation"), uut.SourceLocation);
            Assert.Same(nameTable.Add("snippet"), uut.SnippetAttribute);
            Assert.Same(nameTable.Add("path"), uut.PathAttribute);
            Assert.Same(nameTable.Add("line"), uut.LineAttribute);
            Assert.Same(nameTable.Add("lineEnd"), uut.LineEndAttribute);
            Assert.Same(nameTable.Add("colStart"), uut.ColStartAttribute);
            Assert.Same(nameTable.Add("colEnd"), uut.ColEndAttribute);
            Assert.Same(nameTable.Add("Description"), uut.Description);
            Assert.Same(nameTable.Add("CustomDescription"), uut.CustomDescription);
            Assert.Same(nameTable.Add("classID"), uut.ClassIdAttribute);
            Assert.Same(nameTable.Add("Abstract"), uut.Abstract);
            Assert.Same(nameTable.Add("Explanation"), uut.Explanation);
            Assert.Same(nameTable.Add("UnifiedNodePool"), uut.UnifiedNodePool);
            Assert.Same(nameTable.Add("Node"), uut.Node);
            Assert.Same(nameTable.Add("Action"), uut.Action);
            Assert.Same(nameTable.Add("Snippets"), uut.Snippets);
            Assert.Same(nameTable.Add("Snippet"), uut.Snippet);
            Assert.Same(nameTable.Add("id"), uut.IdAttribute);
            Assert.Same(nameTable.Add("Text"), uut.Text);
            Assert.Same(nameTable.Add("CommandLine"), uut.CommandLine);
            Assert.Same(nameTable.Add("Argument"), uut.Argument);
            Assert.Same(nameTable.Add("Errors"), uut.Errors);
            Assert.Same(nameTable.Add("Error"), uut.Error);
            Assert.Same(nameTable.Add("code"), uut.CodeAttribute);
            Assert.Same(nameTable.Add("MachineInfo"), uut.MachineInfo);
            Assert.Same(nameTable.Add("Hostname"), uut.Hostname);
            Assert.Same(nameTable.Add("Username"), uut.Username);
            Assert.Same(nameTable.Add("Platform"), uut.Platform);
        }
コード例 #2
0
        /// <summary>Initializes a new instance of the <see cref="FortifyFprConverter"/> class.</summary>
        public FortifyFprConverter()
        {
            _nameTable = new NameTable();
            _strings   = new FortifyFprStrings(_nameTable);

            _results                          = new List <Result>();
            _toolNotifications                = new List <Notification>();
            _fileDictionary                   = new Dictionary <string, FileData>();
            _ruleDictionary                   = new Dictionary <string, IRule>();
            _aclToSnippetIdDictionary         = new Dictionary <AnnotatedCodeLocation, string>();
            _resultToSnippetIdDictionary      = new Dictionary <Result, string>();
            _snippetIdToSnippetTextDictionary = new Dictionary <string, string>();
        }
コード例 #3
0
        /// <summary>Initializes a new instance of the <see cref="FortifyFprConverter"/> class.</summary>
        public FortifyFprConverter()
        {
            _nameTable = new NameTable();
            _strings   = new FortifyFprStrings(_nameTable);

            _results                                 = new List <Result>();
            _toolNotifications                       = new List <Notification>();
            _fileDictionary                          = new Dictionary <string, FileData>();
            _ruleDictionary                          = new Dictionary <string, IRule>();
            _tflToNodeIdDictionary                   = new Dictionary <ThreadFlowLocation, string>();
            _tflToSnippetIdDictionary                = new Dictionary <ThreadFlowLocation, string>();
            _locationToSnippetIdDictionary           = new Dictionary <Location, string>();
            _resultToSnippetIdDictionary             = new Dictionary <Result, string>();
            _resultToReplacementDefinitionDictionary = new Dictionary <Result, Dictionary <string, string> >();
            _nodeIdToLocationDictionary              = new Dictionary <string, Location>();
            _snippetIdToRegionsDictionary            = new Dictionary <string, Region[]>();
        }
コード例 #4
0
        /// <summary>Initializes a new instance of the <see cref="FortifyFprConverter"/> class.</summary>
        public FortifyFprConverter()
        {
            _nameTable = new NameTable();
            _strings   = new FortifyFprStrings(_nameTable);
            _currentResultReplacementDictionary = new Dictionary <string, string>();

            _files             = new Dictionary <Uri, Tuple <Artifact, int> >();
            _rules             = new List <ReportingDescriptor>();
            _ruleIdToIndexMap  = new Dictionary <string, int>();
            _cweIds            = new HashSet <string>();
            _nodeDictionary    = new Dictionary <string, Node>();
            _snippetDictionary = new Dictionary <string, Snippet>();

            IncludeContextRegions      = true;
            IncludeSnippets            = true;
            IncludeThreadFlowLocations = true;
        }
コード例 #5
0
        /// <summary>Initializes a new instance of the <see cref="FortifyFprConverter"/> class.</summary>
        public FortifyFprConverter()
        {
            _nameTable = new NameTable();
            _strings   = new FortifyFprStrings(_nameTable);

            _results                                 = new List <Result>();
            _files                                   = new HashSet <Artifact>(Artifact.ValueComparer);
            _rules                                   = new List <ReportingDescriptor>();
            _ruleIdToIndexMap                        = new Dictionary <string, int>();
            _tflToNodeIdDictionary                   = new Dictionary <ThreadFlowLocation, string>();
            _tflToSnippetIdDictionary                = new Dictionary <ThreadFlowLocation, string>();
            _locationToSnippetIdDictionary           = new Dictionary <Location, string>();
            _resultToSnippetIdDictionary             = new Dictionary <Result, string>();
            _resultToReplacementDefinitionDictionary = new Dictionary <Result, Dictionary <string, string> >();
            _nodeIdToLocationDictionary              = new Dictionary <string, Location>();
            _nodeIdToActionTypeDictionary            = new Dictionary <string, string>();
            _snippetIdToRegionsDictionary            = new Dictionary <string, Region[]>();
        }