<commit_before>﻿namespace WpfAnalyzers.DependencyProperties
{
    using System.Threading;

    using Microsoft.CodeAnalysis;
    using Microsoft.CodeAnalysis.CSharp;
    using Microsoft.CodeAnalysis.CSharp.Syntax;

    internal static class ClrMethod
    {
        /// <summary>
        /// Check if <paramref name="method"/> is a potential accessor for an attached property
        /// </summary>
        internal static bool IsPotentialClrSetMethod(this IMethodSymbol method)
        {
            if (method == null)
            {
                return false;
            }

            if (!method.IsStatic ||
                method.Parameters.Length != 2 ||
                !method.Parameters[0].Type.Is(KnownSymbol.DependencyObject) ||
                method.Parameters[1].Type == KnownSymbol.DependencyPropertyChangedEventArgs ||
                !method.ReturnsVoid ||
                !method.Name.StartsWith("Set"))
            {
                return false;
            }

            return true;
        }

        internal static bool IsAttachedSetMethod(IMethodSymbol method, SemanticModel semanticModel, CancellationToken cancellationToken, out IFieldSymbol setField)<commit_msg>Exclude property get & set methods.<commit_after>﻿namespace WpfAnalyzers.DependencyProperties
{
    using System.Threading;

    using Microsoft.CodeAnalysis;
    using Microsoft.CodeAnalysis.CSharp;
    using Microsoft.CodeAnalysis.CSharp.Syntax;

    internal static class ClrMethod
    {
        /// <summary>
        /// Check if <paramref name="method"/> is a potential accessor for an attached property
        /// </summary>
        internal static bool IsPotentialClrSetMethod(this IMethodSymbol method)
        {
            if (method == null)
            {
                return false;
            }

            if (!method.IsStatic ||
                method.Parameters.Length != 2 ||
                method.AssociatedSymbol != null ||
                !method.Parameters[0].Type.Is(KnownSymbol.DependencyObject) ||
                method.Parameters[1].Type == KnownSymbol.DependencyPropertyChangedEventArgs ||
                !method.ReturnsVoid ||
                !method.Name.StartsWith("Set"))
            {
                return false;
            }

            return true;
        }

        internal static bool IsAttachedSetMethod(IMethodSymbol method, SemanticModel semanticModel, CancellationToken cancellationToken, out IFieldSymbol setField)
{'fraction_non_alphanumeric': 0.08485586682907025, 'fraction_numerical': 0.00243605359317905, 'mean_word_length': 2.0122249388753057, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4554756', 'n_tokens_mistral': 604, 'n_tokens_neox': 573, 'n_words': 133}