Search code examples
c#stylecop

StyleCop SA1630


What difference between this methods, why SortDropDown is correct but Page_load and GetCases are not ?

I cant understand.
And how to fix this?

enter image description here

Edit cant see well on picture

Code:

        /// <summary>
        /// Sort items in drop down list
        /// </summary>
        /// <param name="dropDown">Drop down list</param>
        internal static void SortDropDown(ref DropDownList dropDown)
        {

        }

        /// <summary>
        /// PageLoad event handler 
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event Args</param>
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        /// <summary>
        /// Get all cases by authority and ShopNo
        /// </summary>
        /// <param name="authority">Authority</param>
        /// <param name="shopNo">Shop No</param>
        /// <returns>Cases list</returns>
        private static IEnumerable<CaseSummary> GetCases(string authority, string shopNo)
        {

        }


Thanks!


Solution

  • Some of your parameters have a single word as documentation, which is obviously not enough (at least 10 characters + at least a whitespace are required).

    • Sender
    • Authority

    Write a useful description about what is the purpose of these parameters.

    Also, for event handlers, you really should adopt the documentation text that Microsoft uses:

    /// <summary>
    /// Handles the XXXXX event of YYYY.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>