GitXplorerGitXplorer
t

codebux

public
0 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
b721ca28f1baf0f34955c9616d8438f5bc934d82

0.1.0

iinvalid-email-address committed 12 years ago
Unverified
abf425e1496452a6f432d969ee530b66e2872c0f

deduct points for require expressions and errors

iinvalid-email-address committed 12 years ago
Unverified
2f197e140bbecae6f84c0983600c8ccaa56d5a29

show errors on incorrectly resolved files

iinvalid-email-address committed 12 years ago
Unverified
f7293ed11f9af60e6fee4d856aa89f5f5469a606

take multiple files or directories as input

iinvalid-email-address committed 12 years ago
Unverified
1a6340d1eaf9a22c48d53c64ba250c9ae8b9177d

show require expressions and other errors

iinvalid-email-address committed 12 years ago
Unverified
077a763f5f9b494eb52dc358fda808a30861b5a3

check for syntax errors, remove hashbangs

iinvalid-email-address committed 12 years ago

README

The README file for this repository.

codebux

This program computes technical debt for node programs.

Lines of code are spent. You start at $100. You don't get any more codebux.

You lose codebux for:

  • too much code
  • too many deeply-nested expressions

Your codebux score doesn't stop at $0, it keeps going down into the negative numbers.

example

For instance codebux itself has a score of:

$ codebux ~/projects/codebux
+   100.00  # initial stipend
-     5.63  # index.js
-     1.94  # lib/complexity.js
—————————————————————————————————————————————————
+    92.42

other projects don't fare as well:

$ codebux ~/projects/node-browserify
+   100.00  # initial stipend
-    12.55  # index.js
-    34.91  # lib/wrap.js
-     0.33  # lib/wrappers.js
-   100.32  # lib/watch.js
—————————————————————————————————————————————————
-    48.12

usage

usage: codebux [files or directories...]

Recursively trace the static require() dependency graph for every file or
directory provided.

methods

var codebux = require('codebux')

var s = codebux(file, cb)

Compute the codebux for file or directory entry point file. This file or directory's dependency graph will be recursively traversed to compute the score.

At the end of the traversal, cb(err, total) fires with the final codebux tally.

Returns an event emitter that you can latch onto for the specific scores for each file along the way.

events

s.on('price', fucntion (price, desc) { ... })

Emitted when a price gets computed, including the description of the price.

s.on('total', function (total) { ... })

Emitted with the running total every time a cost gets computed.

s.on('file', function (price, file)

Emitted when a file's cost has been completely calculated.

install

With npm, to get the bin script do:

npm install -g codebux

and to get the library do:

npm install codebux

license

MIT