Codify - a TypeScript code analyzer tool that helps developers improve their code's design, reduce complexity, avoid duplication, and identify refactor opportunities. A must-have companion for coding!
npm install codify-tsCodify is a TypeScript library that helps you analyze your code for readability, maintainability, complexity, and more. It's like a spellchecker for your code, but instead of finding spelling mistakes, it finds coding issues!
``bash`
npm install codify-ts
`javascript
import { analyzeDesign, analyzeComplexity, analyzeDuplication, analyzeRefactoring } from 'codify-ts';
const code =
function foo(bar) {
var a = 'hello world';
return a + bar;
}
function foo(bar) {
var a = 'hello world';
return a + bar;
};
console.log(analyzeDesign(code));
console.log(analyzeComplexity(code));
console.log(analyzeDuplication(code));
console.log(analyzeRefactoring(code));
`
Usage should be by implementing the following function in your root file:
`javascript
import { watchAndAnalyze } from 'codify-ts';
watchAndAnalyze('./src', '.js');
`
codify/
|-- src/
| |-- index.ts # Entry point of the library
| |-- analyzers/ # Directory for all analyzer modules
| | |-- index.ts # Exports all analyzers
| | |-- comments.ts # Functions for analyzing comments
| | |-- design.ts # Functions for analyzing design principles
| | |-- complexity.ts # Functions for analyzing code complexity
| | |-- duplication.ts # Functions for detecting code duplication
| | |-- refactor.ts # Functions for suggesting refactoring
| |-- utils/ # Utility functions
| | |-- index.ts # Exports all utility functions
| | |-- ... # Other utility function modules
|-- test/ # Test files
| |-- ... # Test modules for each analyzer
|-- .eslintrc.js # ESLint configuration
|-- .prettierrc.js # Prettier configuration
|-- tsconfig.json # TypeScript configuration
|-- package.json # Project metadata and dependencies
|-- README.md # Project documentation
``Let Codify shine a light on your darkest, deepest, most obscure code! Say goodbye to your fear, and say hello to Codify - the friendly code analyzer! 👋🎉
Happy coding! 🎉