SA1600 : CSharp.Documentation : The class must have a documentation header.

今天遇到的 StyleCop Warning是這一個
SA1600 : CSharp.Documentation : The method must have a documentation header.
SA1600 : CSharp.Documentation : The method must have a documentation header.

當剛剛建立完一個function 之後便會出現..
原因是因為沒有 documentation header 去解釋這一個功能有什麼作用
和他的變數代表什麼
還有會return出來的是什麼等等

public string SayHello(string yourName)
        {
            return "Hello " + yourName;
        }

解決方法十分簡單
只是填上 這個功能的SummaryParameter 是什麼東西 和 Return什麼便可以

解決方法:
E.G.

        /// <summary>
        /// This function is use to say hello to the input [yourName]
        /// </summary>
        /// <param name="yourName">The name to say Hello to</param>
        /// <returns>return "Hello the input name"</returns>
        public string SayHello(string yourName)
        {
            return "Hello " + yourName;
        }

SA1600 : CSharp.Documentation : The method must have a documentation header. (Solved)
Hope you find it useful

Leave a Reply