In some cases StyleCop merges two words together resulting in a false positive spelling warning

Sep 26, 2012 at 9:16 AM

If you create a blank console project and replace the content of program.cs file by this

//-----------------------------------------------------------------------
// <copyright file='Program.cs' company='Cronus Consultancy ltd'>
//     Copyright (c) Cronus consultancy ltd
// </copyright>
//-----------------------------------------------------------------------

namespace TestStyleCop
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// Main class.
    /// </summary>
    public static class Program
    {
        /// <summary>
        /// Gets the business type code
        /// </summary>
        /// <remarks><para>The value returned by this property can be
        /// <list type="bullet">
        /// <item>A real business type code</item>
        /// <item>a fictive one like CEA meaning ceased business</item>
        /// <item>a Continuance Outside Island Code</item>
        /// <item>a Termination Code.</item>
        /// </list></para></remarks>
        public static string BusinessTypeCode
        {
            get { return "ABC"; }
        }

        /// <summary>
        /// Gets the database version this implementation of the module expects.
        /// (in a <c>NNN.MMMM.mmm.nnn</c> form)
        /// </summary>
        /// <value>The database version that the code expects.</value>
        /// <remarks>
        ///     <para>The expected database version will be compared with the actual database
        /// version found in the DatabaseVersion column of the ApplicationModule table. The
        /// module will be loaded if</para>
        ///     <list type="bullet">
        ///         <item>both versions match</item>
        ///         <item>database version &gt; expected version and <font color="black" size="1">DatabaseVersionCheckMode setting value is 0 or 1</font></item>
        ///         <item>database version &lt; expected version and <font color="black" size="1">DatabaseVersionCheckMode setting value is 0 or 2</font></item>
        ///     </list>
        ///     <para><font size="1">The module will not be loaded but the application will start
        /// if the above conditions are not met and the module is optional (value of the
        /// Optional column of the ApplicationModule table)</font></para>
        ///     <para><font size="1">The application will not start (an exception will be thrown)
        /// if the above conditions are not met and the module is a mandatory module (not
        /// optional).</font></para>
        /// </remarks>
        /// <exception cref="T:CronusBiz.Framework.ApplicationModuleException" caption="ApplicationModuleException Exception">
        ///     <list type="bullet">
        ///         <item>The expected version number does not match the actual database version and the module is mandatory.</item>
        ///         <item>The object implementing the module could not be created (needs to be public, non obfuscated and have a parameter-less constructor).</item>
        ///         <item>The module assembly does not exist.</item>
        ///     </list>
        /// </exception>
        public static string ExpectedDatabaseVersion
        {
            get { return "1.0.0.8"; }
        }

        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        /// <param name="args">The arguments.</param>
        public static void Main(string[] args)
        {
            Test();
        }

        /// <summary>
        /// Gets the conditions for a valid reinstatement:
        /// <list type="bullet">
        /// <item>limited life condition</item>
        /// <item>ceased condition</item>
        /// <item>dissolved within n years condition</item>
        /// <item>relocation condition</item>
        /// </list>
        /// </summary>
        private static void Test()
        {
        }
    }
}

you'll get 3 warnings if you run stylecop 4.7.38.0 on the file.

Warning 1 SA1650 : CSharp.Documentation : The documentation text within the remarks tag contains incorrectly spelled words: codea \\vmware-host\shared folders\documents\visual studio 2012\Projects\TestStyleCop\TestStyleCop\Program.cs 30 1 TestStyleCop

Warning 2 SA1650 : CSharp.Documentation : The documentation text within the remarks tag contains incorrectly spelled words: ifboth \\vmware-host\shared folders\documents\visual studio 2012\Projects\TestStyleCop\TestStyleCop\Program.cs 63 1 TestStyleCop

Warning 3 SA1650 : CSharp.Documentation : The documentation text within the summary tag contains incorrectly spelled words: conditionceased \\vmware-host\shared folders\documents\visual studio 2012\Projects\TestStyleCop\TestStyleCop\Program.cs 86 1 TestStyleCop

In each case words were merged together when they should not have been. Actually the words are in different XML documentation tags.

Coordinator
Sep 28, 2012 at 11:29 AM

Fixed in build 4.7.39. Thanks.