Ejemplo n.º 1
0
        private List <string> getAttributesForMethodEx(Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodBlockSyntax node)
        {
            List <string> attributesList = new List <string>();

            if (node.BlockStatement.AttributeLists != null)
            {
                foreach (Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeListSyntax attributeList in node.BlockStatement.AttributeLists)
                {
                    if (attributeList.Attributes != null)
                    {
                        foreach (Microsoft.CodeAnalysis.VisualBasic.Syntax.AttributeSyntax attribute in attributeList.Attributes)
                        {
                            attributesList.Add(attribute.Name.GetText().ToString());
                        }
                    }
                }
            }
            return(attributesList);
        }
 public void VisitEndMethodDeclaration(Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodBlockSyntax node, ExecutionState state)
 {
     //Assert that HttpCookie were configured
     foreach (var variableState in state.Variables)
     {
         var st = variableState.Value;
         if (st.tags.Contains(VariableTag.HttpCookie))
         {
             if (!st.tags.Contains(VariableTag.HttpCookieSecure))
             {
                 state.AnalysisContext.ReportDiagnostic(Diagnostic.Create(RuleSecure, st.node.GetLocation()));
             }
             if (!st.tags.Contains(VariableTag.HttpCookieHttpOnly))
             {
                 state.AnalysisContext.ReportDiagnostic(Diagnostic.Create(RuleHttpOnly, st.node.GetLocation()));
             }
         }
     }
 }
 public void VisitBeginMethodDeclaration(Microsoft.CodeAnalysis.VisualBasic.Syntax.MethodBlockSyntax node, ExecutionState state)
 {
 }