npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

codify-ts

v1.0.5

Published

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!

Downloads

4

Readme

Codify 🚀🎉

"Because there's nothing scarier than your own code!"

Codify 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!

Features 🎁

Design Analyzer: Checks your code for adherence to good design principles. Complexity Analyzer: Calculates the cyclomatic complexity of your code. Duplication Analyzer: Finds duplicate code that may have been unintentionally copied. Refactor Analyzer: Suggests parts of your code that may need refactoring.

Installation 🚀

Use the package manager npm to install codify.

npm install codify-ts

Usage 📖

Here's how you use Codify to analyze some TypeScript code:

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:

import { watchAndAnalyze } from 'codify-ts';

watchAndAnalyze('./src', '.js');

Files structure

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

Keep in Mind 🤔

Codify is not an oracle - it's a tool. It won't write perfect code for you, but it will help you spot potential issues in your code. Remember, the goal is not to achieve zero issues, but to write better, more maintainable code.

Contribution 🤝

Have a cool idea to make Codify even more awesome? Found a bug? Feel free to open an issue or a pull request!

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! 🎉