Ejemplo n.º 1
0
        /// <summary>
        /// The execute transaction inner.
        /// </summary>
        /// <param name="solution">
        /// The solution.
        /// </param>
        /// <param name="textControl">
        /// The text control.
        /// </param>
        public override void ExecuteTransactionInner(ISolution solution, ITextControl textControl)
        {
            IList <ITokenNode> tokensForLine = Utils.GetTokensForLineFromTextControl(solution, textControl);

            foreach (ITokenNode tokenNode in tokensForLine)
            {
                IParenthesizedExpression parenthesizedExpressionNode = tokenNode.GetContainingNode <IParenthesizedExpression>(true);
                MaintainabilityRules.RemoveParenthesisFromNode(parenthesizedExpressionNode);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes all the cleanup.
        /// </summary>
        /// <param name="projectFile">
        /// The project file to clean.
        /// </param>
        /// <param name="file">
        /// The PSI file to clean.
        /// </param>
        /// <param name="fixXmlDocViolations">
        /// Flag to indicate if XML doc stubs should be created
        /// </param>
        private void InternalProcess(IProjectFile projectFile, ICSharpFile file, bool fixXmlDocViolations)
        {
            // Process the file for all the different Code Cleanups we have here
            // we do them in a very specific order. Do not change it.
            Lifetimes.Using(
                lifetime =>
            {
                StyleCopApiPool apiPool = projectFile.GetSolution().GetComponent <StyleCopApiPool>();
                Settings settings       = apiPool.GetInstance(lifetime).Settings.GetSettings(projectFile);

                ReadabilityRules.ExecuteAll(file, settings);
                MaintainabilityRules.ExecuteAll(file, settings);

                if (fixXmlDocViolations)
                {
                    DocumentationRules.ExecuteAll(file, settings);
                }

                LayoutRules.ExecuteAll(file, settings);
                SpacingRules.ExecuteAll(file, settings);
                OrderingRules.ExecuteAll(file, settings);
            });
        }
Ejemplo n.º 3
0
 public void Maintainability()
 {
     Scope.Validate(Codebase,
                    MaintainabilityRules.Immutable_Types_Should_Be_Immutable,
                    MaintainabilityRules.Ncca_Is_Used_Properly(38));
 }