Skip to content

JLraining/code-analysis-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-analysis-cli

Introduction

Dependency Management: Code Changed Impact Analysis

Background Information

During the development process, it is common to modify shared code. For a simple modification, the impact can usually be manually controlled. However, if a large number of modifications are made at once or if this code is widely referenced in the project, it is difficult to determine its impact range through manual control or by using VSCode's search function. Therefore, a code analysis tool is needed.

This tool can help scan the code changes in files and where they are referenced in the project.

config

image

for example, as the simple demo shows in project, if we changed [Person, Address] in shared file (IMPORT_FILE_PATH), in project we imported and used [Person, Address] from shared dir, we need to scan all the places where used these two changes, and output the report (as below), we can get which files imported the changed files, and which line used the changed code.

output

image

Implementation

The general idea is to use git diff to obtain the modified code blocks, analyze the changed code through AST, and finally scan the referenced files to analyze where they are used.

Details: https://jlraining.github.io/code+analysis.html

Try it with demo

  • change demo/shared code
  • code-analysis-cli run analyze the change

About

Dependency Management: Typescript Code Analysis

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published