The application provides a kind of
redundant code identification method and
system based on data flow graph, solve the problem that prior art cannot comprehensively identify multiple types of
redundant code. Through the set operation
processing of interface access log, full
station scanning result and code repository information, a set of abandoned interfaces is identified;Based on
static analysis tool and
abstract syntax tree, dynamic call detection and
data flow analysis are carried out to identify a set of internal useless codes;Then, through the state check and log analysis of
consumer running state, script execution
record and task scheduling configuration, a set of abandoned scripts and a set of abandoned consumers are identified and merged to form a set of abandoned components;Further, a
system call graph is constructed to perform reverse
reachability analysis, to identify a set of cascading abandoned codes;Finally, based on the above various sets, a complete
redundant code report containing statistical data, detailed
list and
risk assessment is generated.