Class SeCheck

  • All Implemented Interfaces:
    JavaScriptCheck

    public class SeCheck
    extends Object
    implements JavaScriptCheck
    Extend this class to implement a new check based on symbolic execution.
    • Constructor Detail

      • SeCheck

        public SeCheck()
    • Method Detail

      • checkConditions

        public void checkConditions​(Map<Tree,​Collection<Constraint>> conditions)
        Override this method to check the constraints on conditions (TRUTHY or FALSY) in current execution (aka function scope). This method is called after end of execution. Note that it's not called if execution was not finished due reaching the execution limit.
      • beforeBlockElement

        public void beforeBlockElement​(ProgramState currentState,
                                       Tree element,
                                       ProgramPoint programPoint)
        Override this method to perform actions before executing element. This method is called before each element until end of execution or reaching the execution limit.
        Parameters:
        currentState - current state at the program point preceding element
        element - syntax tree to be executed next
        programPoint - current programPoint associated to the element
      • afterBlockElement

        public void afterBlockElement​(ProgramState currentState,
                                      Tree element)
        Override this method to perform actions after executing element. This method is called after each element until end of execution or reaching the execution limit.
        Parameters:
        currentState - current state at the program point following element
        element - last executed syntax tree
      • cleanupAndStartFileAnalysis

        public void cleanupAndStartFileAnalysis​(ScriptTree scriptTree)
      • startOfFile

        protected void startOfFile​(ScriptTree scriptTree)
        Override this method to perform actions before any analysis is performed
        Parameters:
        scriptTree - the scriptTree that is going to be analyzed
      • endOfFile

        public void endOfFile​(ScriptTree scriptTree)
      • endOfExecution

        public void endOfExecution​(Scope functionScope)
        Override this method to perform actions when the execution is finished. This method is called for each execution, i.e. for each function in the file. Note this method is not called if the execution limit was reached.
        Parameters:
        functionScope - scope corresponding to the function which was executed
      • startOfExecution

        public void startOfExecution​(Scope functionScope)
        Override this method to perform actions before the start of execution. This method is called for each execution, i.e. for each function in the file. Note this method is called even if the execution limit was reached later.
        Parameters:
        functionScope - scope corresponding to the function which will be executed
      • addIssue

        public <T extends Issue> T addIssue​(T issue)
        Description copied from interface: JavaScriptCheck
        Use this method only to add specific kind of issue. E.g. you can use this method to add issue on file level, line issue or precise issue with sophisticated primary location.

        Otherwise please use JavaScriptCheck.addIssue(Tree, String)

Specified by:
addIssue in interface JavaScriptCheck