Hairball is a plugin-able framework useful for static analysis of Scratch projects.
Project description
# Hairball
Hairball is a plugin-able framework useful for static analysis of Scratch
projects.
The paper and presentation slides for Hairball can be found at:
http://cs.ucsb.edu/~bboe/p/cv#sigcse13
A Hairball demo web service is running and available at:
http://hairball.herokuapp.com
## Hairball installation
With a proper python environment (one which has `pip` available), installation
is as simple as `pip install hairball`. `easy_install` can also be used via
`easy_install hairball`.
To install from source, first checkout this project and then navigate your
command-line interface to the outer hairball directory that contains
`setup.py`. Then run `python setup.py install`.
## Running Hairball
Once installed, to see how to use hairball run `hairball --help`. That will
produce output similar to the following:
```
Usage: hairball -p PLUGIN_NAME [options] PATH...
PATH can be either the path to a scratch file, or a directory containing
scratch files. Multiple PATH arguments can be provided.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-d DIR, --plugin-dir=DIR
Specify the path to a directory containing plugins.
Plugins in this directory take precedence over
similarly named plugins included with Hairball.
-p PLUGIN, --plugin=PLUGIN
Use the named plugin to perform analysis. This option
can be provided multiple times.
-k KURT_PLUGIN, --kurt-plugin=KURT_PLUGIN
Provide either a python import path (e.g, kelp.octopi)
to a package/module, or the path to a python file,
which will be loaded as a Kurt plugin. This option can
be provided multiple times.
```
## Available Plugins
Below are a list of available plugins that can be used as the `-p PLUGIN_NAME`
option:
* blocks.BlockCounts
* blocks.DeadCode
* checks.Animation (not fully tested)
* checks.BroadcastReceive
* checks.SaySoundSync (not fully tested)
* duplicate.DuplicateScripts
* initialization.AttributeInitialization
* initialization.VariableInitialization (not fully tested)
Note: The output for each plugin is not yet completely standardized. Please
feel free to file any issues or make improvements and send pull requests.
## Caching Support
The python Kurt package unfortunately is pretty slow to parse Scratch 1.4 (and
similar) files. To remedy this situation, Hairball has built-in support for
caching a serialized version of the Kurt object. On subsequent passes through
the same data you should notice a TREMENDOUS speed improvement.
__Note__: At the moment the cache is unbounded, so keep an eye on your disk
space. The cache location can be discovered by running:
python -c "import appdirs; print appdirs.user_cache_dir('Hairball', 'bboe')"
Hairball is a plugin-able framework useful for static analysis of Scratch
projects.
The paper and presentation slides for Hairball can be found at:
http://cs.ucsb.edu/~bboe/p/cv#sigcse13
A Hairball demo web service is running and available at:
http://hairball.herokuapp.com
## Hairball installation
With a proper python environment (one which has `pip` available), installation
is as simple as `pip install hairball`. `easy_install` can also be used via
`easy_install hairball`.
To install from source, first checkout this project and then navigate your
command-line interface to the outer hairball directory that contains
`setup.py`. Then run `python setup.py install`.
## Running Hairball
Once installed, to see how to use hairball run `hairball --help`. That will
produce output similar to the following:
```
Usage: hairball -p PLUGIN_NAME [options] PATH...
PATH can be either the path to a scratch file, or a directory containing
scratch files. Multiple PATH arguments can be provided.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-d DIR, --plugin-dir=DIR
Specify the path to a directory containing plugins.
Plugins in this directory take precedence over
similarly named plugins included with Hairball.
-p PLUGIN, --plugin=PLUGIN
Use the named plugin to perform analysis. This option
can be provided multiple times.
-k KURT_PLUGIN, --kurt-plugin=KURT_PLUGIN
Provide either a python import path (e.g, kelp.octopi)
to a package/module, or the path to a python file,
which will be loaded as a Kurt plugin. This option can
be provided multiple times.
```
## Available Plugins
Below are a list of available plugins that can be used as the `-p PLUGIN_NAME`
option:
* blocks.BlockCounts
* blocks.DeadCode
* checks.Animation (not fully tested)
* checks.BroadcastReceive
* checks.SaySoundSync (not fully tested)
* duplicate.DuplicateScripts
* initialization.AttributeInitialization
* initialization.VariableInitialization (not fully tested)
Note: The output for each plugin is not yet completely standardized. Please
feel free to file any issues or make improvements and send pull requests.
## Caching Support
The python Kurt package unfortunately is pretty slow to parse Scratch 1.4 (and
similar) files. To remedy this situation, Hairball has built-in support for
caching a serialized version of the Kurt object. On subsequent passes through
the same data you should notice a TREMENDOUS speed improvement.
__Note__: At the moment the cache is unbounded, so keep an eye on your disk
space. The cache location can be discovered by running:
python -c "import appdirs; print appdirs.user_cache_dir('Hairball', 'bboe')"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hairball-0.2.tar.gz
(13.4 kB
view details)
Built Distribution
File details
Details for the file hairball-0.2.tar.gz
.
File metadata
- Download URL: hairball-0.2.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eec911729a8c72fca7b95f7d1e360d76b75c0de62505d435ca49d9f30670bf97 |
|
MD5 | 9a3b5945f48c3d53453ffaf5d61168a4 |
|
BLAKE2b-256 | 5030843490ad570be679631dc2e6ee151ade4c2a6aa7581bb6371b16290da6f4 |
File details
Details for the file hairball-0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: hairball-0.2-py2.py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea74e8cdd259cab495517cae633240efda5176a04ca9a4768391521f9590aff4 |
|
MD5 | cf671183c1a03b024b3d2c0b68b0bdf6 |
|
BLAKE2b-256 | 1de8f69dce66f8422734862b275bc8a431e0fa98beb47e7371cb5cb3365edb7c |