Skip to content

Commit

Permalink
Add FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
vesln committed Nov 16, 2013
1 parent 9ff74ca commit 55f2eb0
Showing 1 changed file with 51 additions and 2 deletions.
53 changes: 51 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,59 @@ Hell is an experimental complexity analyzer for JavaScript projects.
--formatter <name> specify formatter to use
--formatters display all formatters
```
## Formatters

## Description
## FAQ

## Formatters
#### How does it work?

It will statically analyze your code and count branches, assignments, function
calls etc. These have different score. For instance branch is 10,
assignment 3 etc.

#### When to use it?

It's perfect when you are joining a new project since it can give
you a quick overview of where most of the complexity is. I consider it useful
when dealing with code that I don't know perfectly well too.
You are about to do some refactoring? Hell will give you hints what to tackle.

#### Why is this even useful?

Nobody likes God classes/functions.
Take a look at the [Single responsibility principle](http://en.wikipedia.org/wiki/Single_responsibility_principle) and think about it
a little bit. Is your method/class doing too much? Can it be simplified? Can it
be improved?

#### That's fine. Numbers. How do I decrease the complexity and make them
smaller?

Great question, thanks for asking! There is no universal answer to this and
really depends on the app that you are working on. Keep in mind that even if you
have the perfect code it will still have complexity in it, which is fine.
However, a lot of complexity concentrated in one single place is a bad sign and you
should be aware of it.

#### Is this tool perfect?

No.

#### I can cheat it! I can decrease the complexity but keep the same behavior!

It's probably a bug, which shouldn't be surprising given the early stage of the
project. Reporting problems is highly appreciated!

#### Can we improve it somehow?

Totally! This is just an initial implementation and I would love to hear ideas and merge
pull requests in.

#### I have a function that hasn't been detected as complex enough. What do we
do?

That's actually awesome! Please open a new issue with the code and explain why you
think it's giving you a wrong result. From there we can discuss and improve the
tool.

## Installation

Expand Down

0 comments on commit 55f2eb0

Please sign in to comment.