public class JsChecker extends AbstractChecker
Eg. console.log, alert(...), debugger, trailing comma, ...
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMENT_REGEX |
static java.lang.String |
IGNORE_CHECK_ALERT |
static java.lang.String |
IGNORE_CHECK_COMMA |
static java.lang.String |
IGNORE_CHECK_CONSOLE |
static java.lang.String |
IGNORE_CHECK_DEBUGGER |
static java.lang.String |
IGNORE_CHECK_HREF |
static java.lang.String |
REVISION |
CHANNEL, PROP_SUFFIX_FILE_FILTER
Constructor and Description |
---|
JsChecker() |
Modifier and Type | Method and Description |
---|---|
static void |
checkAlert(CheckResult result,
CheckedFile file,
CheckerContext checkerContext) |
static CheckResult |
checkAll(java.io.File webappDir) |
static void |
checkConsole(CheckResult result,
CheckedFile file,
CheckerContext checkerContext) |
static void |
checkDebugger(CheckResult result,
CheckedFile file,
CheckerContext checkerContext) |
static void |
checkHrefAttribute(CheckResult result,
CheckedFile file,
CheckerContext checkerContext) |
static void |
checkPattern(java.lang.String checkName,
org.apache.oro.text.regex.Pattern invalidUsePattern,
java.util.regex.Pattern[] authorizedUsePatterns,
CheckResult result,
CheckedFile file)
Check if the specified invalid pattern is part of any lines in the javascript File being analyez
|
static void |
checkTrailingComma(CheckResult result,
CheckedFile file,
CheckerContext checkerContext) |
protected static java.util.List<java.io.File> |
getFileList(java.io.File webappDir) |
static void |
main(java.lang.String[] args) |
loadLanguageProperties, loadProperties, loadProperties, saveError
public static final java.lang.String REVISION
public static final java.lang.String IGNORE_CHECK_CONSOLE
public static final java.lang.String IGNORE_CHECK_ALERT
public static final java.lang.String IGNORE_CHECK_DEBUGGER
public static final java.lang.String IGNORE_CHECK_HREF
public static final java.lang.String IGNORE_CHECK_COMMA
public static final java.lang.String COMMENT_REGEX
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
protected static java.util.List<java.io.File> getFileList(java.io.File webappDir)
public static CheckResult checkAll(java.io.File webappDir) throws java.io.IOException
java.io.IOException
public static void checkConsole(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
java.io.IOException
public static void checkAlert(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
java.io.IOException
public static void checkDebugger(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
java.io.IOException
public static void checkHrefAttribute(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
java.io.IOException
public static void checkTrailingComma(CheckResult result, CheckedFile file, CheckerContext checkerContext) throws java.io.IOException
java.io.IOException
public static void checkPattern(java.lang.String checkName, org.apache.oro.text.regex.Pattern invalidUsePattern, java.util.regex.Pattern[] authorizedUsePatterns, CheckResult result, CheckedFile file)
checkName
- the name of the check being formed (used in log message)invalidUsePattern
- a perl Pattern which MUST NOT be part of any line (excepted in comment)authorizedUsePatterns
- optionnal perl pattern which are authorized even though invalid pattern has matchedresult
- the CheckResult instance filled with the analysis resultfile
- wrapper of file being testedCopyright © 2001-2017 Jalios SA. All Rights Reserved.