Click here to Skip to main content
15,896,455 members
Articles / Programming Languages / C#

NAnt Task to Capture Out of Bounds Source Monitor Metrics

Rate me:
Please Sign up or sign in to vote.
3.00/5 (1 vote)
12 Jun 2009CPOL5 min read 22.2K   61   6  
NAnt user task that adds alarms on top of Source Monitor metrics to highlight source code that does not follow coding rules.
using System;
using System.Collections.Generic;
using System.Text;

namespace NAnt.SMAnalyzerTasks
{
    /// <summary>
    /// Class to handle Source Monitor Metric.
    /// </summary>
    /// <remarks>
    /// a metric is just seen as an Id and a value.
    /// <br>Id must be SourceMonitor short names: M0 M1 ... M14.</br>
    /// </remarks>
    class SMMetric
    {
        private string m_sId;
        private string m_sValue;

        #region Constructors

        public SMMetric()
        {
            m_sId= "";
            m_sValue= "";
        }

        public SMMetric(string _sId, string _sValue)
        {
            m_sId = _sId;
            m_sValue = _sValue;
        }

        #endregion


        #region Class Properties

        public string ID
        {
            get { return m_sId; }
            set { m_sId = value; }
        }

        public string Value
        {
            get { return m_sValue; }
            set { m_sValue = value; }
        }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Schlumberger
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions