private static void CheckCompanyName(SyntaxTreeAnalysisContext context, DocumentationSettings documentationSettings, Compilation compilation, XmlFileHeader fileHeader, XElement copyrightElement)
            {
                var companyName = copyrightElement.Attribute("company")?.Value;

                if (string.IsNullOrWhiteSpace(companyName))
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1640Descriptor, location));
                    return;
                }

                if (compilation.IsAnalyzerSuppressed(SA1641Descriptor))
                {
                    return;
                }

                if (string.Equals(documentationSettings.CompanyName, DocumentationSettings.DefaultCompanyName, StringComparison.OrdinalIgnoreCase))
                {
                    // The company name is meaningless until configured by the user.
                    return;
                }

                if (string.CompareOrdinal(companyName, documentationSettings.CompanyName) != 0)
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1641Descriptor, location));
                }
            }
            private static void CheckCopyrightText(SyntaxTreeAnalysisContext context, DocumentationSettings documentationSettings, Compilation compilation, XmlFileHeader fileHeader, XElement copyrightElement)
            {
                var copyrightText = copyrightElement.Value;

                if (string.IsNullOrWhiteSpace(copyrightText))
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1635Descriptor, location));
                    return;
                }

                if (compilation.IsAnalyzerSuppressed(SA1636Descriptor))
                {
                    return;
                }

                string fileName = Path.GetFileName(context.Tree.FilePath);
                var    settingsCopyrightText = documentationSettings.GetCopyrightText(fileName);

                if (string.Equals(settingsCopyrightText, DocumentationSettings.DefaultCopyrightText, StringComparison.OrdinalIgnoreCase))
                {
                    // The copyright text is meaningless until the company name is configured by the user.
                    return;
                }

                // trim any leading / trailing new line or whitespace characters (those are a result of the XML formatting)
                if (!CompareCopyrightText(context, documentationSettings, copyrightText.Trim('\r', '\n', ' ', '\t')))
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1636Descriptor, location));
                }
            }
        private static void CheckCompanyName(SyntaxTreeAnalysisContext context, Compilation compilation, XmlFileHeader fileHeader, XElement copyrightElement, StyleCopSettings settings)
        {
            var companyName = copyrightElement.Attribute("company")?.Value;

            if (string.IsNullOrWhiteSpace(companyName))
            {
                var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                context.ReportDiagnostic(Diagnostic.Create(SA1640Descriptor, location));
                return;
            }

            if (compilation.IsAnalyzerSuppressed(SA1641Identifier))
            {
                return;
            }

            if (string.CompareOrdinal(companyName, settings.DocumentationRules.CompanyName) != 0)
            {
                var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                context.ReportDiagnostic(Diagnostic.Create(SA1641Descriptor, location));
            }
        }
            private static void CheckFile(SyntaxTreeAnalysisContext context, Compilation compilation, XmlFileHeader fileHeader, XElement copyrightElement)
            {
                var fileAttribute = copyrightElement.Attribute("file");

                if (fileAttribute == null)
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1637Descriptor, location));
                    return;
                }

                if (compilation.IsAnalyzerSuppressed(SA1638Descriptor))
                {
                    return;
                }

                var fileName = Path.GetFileName(context.Tree.FilePath);

                if (string.CompareOrdinal(fileAttribute.Value, fileName) != 0)
                {
                    var location = fileHeader.GetElementLocation(context.Tree, copyrightElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1638Descriptor, location));
                }
            }
            private static void CheckSummaryHeader(SyntaxTreeAnalysisContext context, Compilation compilation, XmlFileHeader fileHeader)
            {
                var summaryElement = fileHeader.GetElement("summary");

                if (summaryElement == null)
                {
                    context.ReportDiagnostic(Diagnostic.Create(SA1639Descriptor, fileHeader.GetLocation(context.Tree)));
                    return;
                }

                if (string.IsNullOrWhiteSpace(summaryElement.Value))
                {
                    var location = fileHeader.GetElementLocation(context.Tree, summaryElement);
                    context.ReportDiagnostic(Diagnostic.Create(SA1639Descriptor, location));
                }
            }