<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
using System.Web.Mvc;
using System.Web.Routing;

namespace FluentSitemap.Core
{
    public static class SitemapHelper
    {
        public static string GetControllerName(Type type)
        {
            string controllerName = type.Name;

            if (controllerName.EndsWith("Controller", StringComparison.InvariantCultureIgnoreCase))
                controllerName = controllerName.Substring(0, controllerName.Length - "Controller".Length);

            return controllerName;
        }

        public static string GetActionName(MethodInfo action)
        {
            string actionName = action.Name;

            var actionNameAttributes = (ActionNameAttribute[])action.GetCustomAttributes(typeof(ActionNameAttribute), false);

            if ((actionNameAttributes != null) && (actionNameAttributes.Length > 0))
                actionName = actionNameAttributes[0].Name;

            return actionName;
        }

        public static RouteValueDictionary GetParameters(MethodCallExpression method)
        {
            var parameters = method.Method.GetParameters();
            var values = new RouteValueDictionary();

            for (int i = 0; i < parameters.Length; i++ )
            {
                var value = ((ConstantExpression) method.Arguments[i]).Value;
                var name = parameters[i].Name;

                values.Add(name, value);
            }

            return values;
        }
    }
}
<commit_msg>added Marks changes<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
using System.Web.Mvc;
using System.Web.Routing;

namespace FluentSitemap.Core
{
    public static class SitemapHelper
    {
        public static string GetControllerName<T>()
        {
            return GetControllerName(typeof (T));
        }

        public static string GetControllerName(Type type)
        {
            string controllerName = type.Name;

            if (controllerName.EndsWith("Controller", StringComparison.InvariantCultureIgnoreCase))
                controllerName = controllerName.Substring(0, controllerName.Length - "Controller".Length);

            return controllerName;
        }

        public static string GetActionName(MethodInfo action)
        {
            string actionName = action.Name;

            var actionNameAttributes = (ActionNameAttribute[])action.GetCustomAttributes(typeof(ActionNameAttribute), false);

            if ((actionNameAttributes != null) && (actionNameAttributes.Length > 0))
                actionName = actionNameAttributes[0].Name;

            return actionName;
        }

        public static RouteValueDictionary GetParameters(MethodCallExpression method)
        {
            var parameters = method.Method.GetParameters();
            var values = new RouteValueDictionary();

            for (int i = 0; i < parameters.Length; i++ )
            {
                var value = ((ConstantExpression) method.Arguments[i]).Value;
                var name = parameters[i].Name;

                values.Add(name, value);
            }

            return values;
        }
    }
}

{'fraction_non_alphanumeric': 0.08616988653787182, 'fraction_numerical': 0.0024532352039251764, 'mean_word_length': 2.278391959798995, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '2118649', 'n_tokens_mistral': 793, 'n_tokens_neox': 764, 'n_words': 181}