Exemplo n.º 1
0
        /// <summary>
        /// To check whether an invocation is a logging statement
        /// </summary>
        static public bool IsLoggingStatement(SyntaxNode statement)
        {
            string logging = IOFile.MethodNameExtraction(statement.ToString());

            if (logging == null)
            {
                return(false);
            }

            foreach (string notlogmethod in Config.NotLogMethods)
            {
                if (notlogmethod == "")
                {
                    break;
                }
                if (logging.IndexOf(notlogmethod) > -1)
                {
                    return(false);
                }
            }
            foreach (string logmethod in Config.LogMethods)
            {
                if (logging.IndexOf(logmethod) > -1)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 2
0
        static public bool IsGetCauseStatement(SyntaxNode statement)
        {
            string getCause = IOFile.MethodNameExtraction(statement.ToString());

            if (getCause == null)
            {
                return(false);
            }

            string[] getCauseMethods = { "InnerException" };

            foreach (string getCauseMethod in getCauseMethods)
            {
                if (getCause.IndexOf(getCauseMethod) > -1)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 3
0
        /// <summary>
        /// To check whether an invocation is a logging statement
        /// </summary>
        static public bool IsAbortStatement(SyntaxNode statement)
        {
            string aborting = IOFile.MethodNameExtraction(statement.ToString());

            if (aborting == null)
            {
                return(false);
            }

            string[] abortMethods = { "Exit", "Abort" };

            foreach (string abortMethod in abortMethods)
            {
                if (aborting.IndexOf(abortMethod) > -1)
                {
                    return(true);
                }
            }
            return(false);
        }