private static Diagnostic CreateDiagnostic(DiagnosticDescriptor diagnosticDescriptor, Location location, string message, IssueKind?issueKind = null)
        {
            var severity = issueKind?.ToDiagnosticSeverity() ?? diagnosticDescriptor.DefaultSeverity;

            return(Diagnostic.Create(
                       diagnosticDescriptor.Id,
                       diagnosticDescriptor.Category,
                       message,
                       severity: severity,
                       defaultSeverity: diagnosticDescriptor.DefaultSeverity,
                       isEnabledByDefault: true,
                       warningLevel: GetWarningLevel(severity),
                       location: location,
                       helpLink: diagnosticDescriptor.HelpLinkUri,
                       title: diagnosticDescriptor.Title));
        }