<commit_before>﻿// ==========================================================================
//  Squidex Headless CMS
// ==========================================================================
//  Copyright (c) Squidex UG (haftungsbeschraenkt)
//  All rights reserved. Licensed under the MIT license.
// ==========================================================================

using System;
using Orleans;

namespace Squidex.Infrastructure.Commands
{
    public static class DomainObjectGrainFormatter
    {
        public static string Format(IGrainCallContext context)
        {
            if (context.Method == null)
            {
                return "Unknown";
            }

            if (string.Equals(context.Method.Name, nameof(IDomainObjectGrain.ExecuteAsync), StringComparison.CurrentCultureIgnoreCase) &&
                context.Arguments?.Length == 1 &&
                context.Arguments[0] != null)
            {
                return context.Arguments[0].ToString();
            }

            return context.Method.Name;
        }
    }
}<commit_msg>Method name improved.<commit_after>﻿// ==========================================================================
//  Squidex Headless CMS
// ==========================================================================
//  Copyright (c) Squidex UG (haftungsbeschraenkt)
//  All rights reserved. Licensed under the MIT license.
// ==========================================================================

using System;
using Orleans;

namespace Squidex.Infrastructure.Commands
{
    public static class DomainObjectGrainFormatter
    {
        public static string Format(IGrainCallContext context)
        {
            if (context.Method == null)
            {
                return "Unknown";
            }

            if (string.Equals(context.Method.Name, nameof(IDomainObjectGrain.ExecuteAsync), StringComparison.CurrentCultureIgnoreCase) &&
                context.Arguments?.Length == 1 &&
                context.Arguments[0] != null)
            {
                var argumentFullName = context.Arguments[0].ToString();
                var argumentParts = argumentFullName.Split('.');
                var argumentName = argumentParts[argumentParts.Length - 1];

                return $"{nameof(IDomainObjectGrain.ExecuteAsync)}({argumentName})";
            }

            return context.Method.Name;
        }
    }
}
{'fraction_non_alphanumeric': 0.26525529265255293, 'fraction_numerical': 0.0029057700290577005, 'mean_word_length': 2.685015290519878, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3315609', 'n_tokens_mistral': 577, 'n_tokens_neox': 517, 'n_words': 110}