<commit_before>namespace Umbraco.Cms.Core.PropertyEditors;

/// <summary>
///     Marks a ConfigurationEditor property as a configuration field, and a class as a configuration field type.
/// </summary>
/// <remarks>Properties marked with this attribute are discovered as fields.</remarks>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)]
public class ConfigurationFieldAttribute : Attribute
{
    private Type? _type;

    /// <summary>
    ///     Initializes a new instance of the <see cref="ConfigurationField" /> class.
    /// </summary>
    public ConfigurationFieldAttribute(Type type)
    {
        Type = type;
        Key = string.Empty;
    }

    /// <summary>
    ///     Initializes a new instance of the <see cref="ConfigurationField" /> class.
    /// </summary>
    /// <param name="key">The unique identifier of the field.</param>
    /// <param name="name">The friendly name of the field.</param>
    /// <param name="view">The view to use to render the field editor.</param>
    public ConfigurationFieldAttribute(string key, string name, string view)
    {
        if (key == null)
        {
            throw new ArgumentNullException(nameof(key));
        }

        if (string.IsNullOrWhiteSpace(key))
        {
            throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(key));
        }

        if (name == null)
        {
            throw new ArgumentNullException(nameof(name));
        }

        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(name));
        }

        if (view == null)
        {
            throw new ArgumentNullException(nameof(view));
        }

        if (string.IsNullOrWhiteSpace(view))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(view));
        }

        Key = key;
        Name = name;
        View = view;
    }

    /// <summary>
    ///     Initializes a new instance of the <see cref="ConfigurationField" /> class.
    /// </summary>
    /// <param name="name">The friendly name of the field.</param>
    /// <param name="view">The view to use to render the field editor.</param>
    /// <remarks>
    ///     When no key is specified, the <see cref="ConfigurationEditor" /> will derive a key
    ///     from the name of the property marked with this attribute.
    /// </remarks>
    public ConfigurationFieldAttribute(string name, string view)
    {
        if (name == null)
        {
            throw new ArgumentNullException(nameof(name));
        }

        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(name));
        }

        if (view == null)
        {
            throw new ArgumentNullException(nameof(view));
        }

        if (string.IsNullOrWhiteSpace(view))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(view));
        }

        Name = name;
        View = view;
        Key = string.Empty;
    }

    /// <summary>
    ///     Gets or sets the key of the field.
    /// </summary>
    /// <remarks>
    ///     When null or empty, the <see cref="ConfigurationEditor" /> should derive a key
    ///     from the name of the property marked with this attribute.
    /// </remarks>
    public string Key { get; }

    /// <summary>
    ///     Gets the friendly name of the field.
    /// </summary>
    public string? Name { get; }

    /// <summary>
    ///     Gets or sets the view to use to render the field editor.
    /// </summary>
    public string? View { get; }

    /// <summary>
    ///     Gets or sets the description of the field.
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    ///     Gets or sets a value indicating whether the field editor should be displayed without its label.
    /// </summary>
    public bool HideLabel
    {
        get => HideLabelSettable.ValueOrDefault(false);
        set => HideLabelSettable.Set(value);
    }
<commit_msg>Fix comment of view property in `ConfigurationFieldAttribute` (#13077)<commit_after>namespace Umbraco.Cms.Core.PropertyEditors;

/// <summary>
///     Marks a ConfigurationEditor property as a configuration field, and a class as a configuration field type.
/// </summary>
/// <remarks>Properties marked with this attribute are discovered as fields.</remarks>
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class)]
public class ConfigurationFieldAttribute : Attribute
{
    private Type? _type;

    /// <summary>
    ///     Initializes a new instance of the <see cref="ConfigurationField" /> class.
    /// </summary>
    public ConfigurationFieldAttribute(Type type)
    {
        Type = type;
        Key = string.Empty;
    }

    /// <summary>
    ///     Initializes a new instance of the <see cref="ConfigurationField" /> class.
    /// </summary>
    /// <param name="key">The unique identifier of the field.</param>
    /// <param name="name">The friendly name of the field.</param>
    /// <param name="view">The view to use to render the field editor.</param>
    public ConfigurationFieldAttribute(string key, string name, string view)
    {
        if (key == null)
        {
            throw new ArgumentNullException(nameof(key));
        }

        if (string.IsNullOrWhiteSpace(key))
        {
            throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(key));
        }

        if (name == null)
        {
            throw new ArgumentNullException(nameof(name));
        }

        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(name));
        }

        if (view == null)
        {
            throw new ArgumentNullException(nameof(view));
        }

        if (string.IsNullOrWhiteSpace(view))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(view));
        }

        Key = key;
        Name = name;
        View = view;
    }

    /// <summary>
    ///     Initializes a new instance of the <see cref="ConfigurationField" /> class.
    /// </summary>
    /// <param name="name">The friendly name of the field.</param>
    /// <param name="view">The view to use to render the field editor.</param>
    /// <remarks>
    ///     When no key is specified, the <see cref="ConfigurationEditor" /> will derive a key
    ///     from the name of the property marked with this attribute.
    /// </remarks>
    public ConfigurationFieldAttribute(string name, string view)
    {
        if (name == null)
        {
            throw new ArgumentNullException(nameof(name));
        }

        if (string.IsNullOrWhiteSpace(name))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(name));
        }

        if (view == null)
        {
            throw new ArgumentNullException(nameof(view));
        }

        if (string.IsNullOrWhiteSpace(view))
        {
            throw new ArgumentException(
                "Value can't be empty or consist only of white-space characters.",
                nameof(view));
        }

        Name = name;
        View = view;
        Key = string.Empty;
    }

    /// <summary>
    ///     Gets the key of the field.
    /// </summary>
    /// <remarks>
    ///     When null or empty, the <see cref="ConfigurationEditor" /> should derive a key
    ///     from the name of the property marked with this attribute.
    /// </remarks>
    public string Key { get; }

    /// <summary>
    ///     Gets the friendly name of the field.
    /// </summary>
    public string? Name { get; }

    /// <summary>
    ///     Gets the view to use to render the field editor.
    /// </summary>
    public string? View { get; }

    /// <summary>
    ///     Gets or sets the description of the field.
    /// </summary>
    public string? Description { get; set; }

    /// <summary>
    ///     Gets or sets a value indicating whether the field editor should be displayed without its label.
    /// </summary>
    public bool HideLabel
    {
        get => HideLabelSettable.ValueOrDefault(false);
        set => HideLabelSettable.Set(value);
    }

{'fraction_non_alphanumeric': 0.11362863940183528, 'fraction_numerical': 0.0005664438654129376, 'mean_word_length': 1.8906352324819908, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 85, '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': '1563935', 'n_tokens_mistral': 2301, 'n_tokens_neox': 2259, 'n_words': 771}