Self-hosted open source app to control metrics of your code. Code Stats lets to control the quality of your code by integrating your Github pull requests with any metric you want.
By including the Code Stats Metrics Reporter gem in your app and setting up the .codestats.yml
file, your Continous Integration will run certains scripts that will let Code Stats list all the metrics you want and run custom checks whenever you create a Github Pull Request
You can add a Code Stats badge to you README by adding the following:
[![Codestats](http://your-codestats-url/organizations/an-organization/projects/a-project/badge)]((http://your-codestats-url/organizations/an-organization/projects/a-project/badge)
it will look something like this:
- Clone the repository by running
git clone git@github.com:Wolox/codestats.git
- Go to the project root by running
cd codestats
- Download and install Rbenv.
- Download and install Ruby-Build.
- Install the appropriate Ruby version by running
rbenv install [version]
whereversion
is the one located in .ruby-version
- Install Bundler.
- Install basic dependencies if you are using Ubuntu:
sudo apt-get install build-essential libpq-dev nodejs
- Install all the gems included in the project.
gem install bundler --no-ri --no-rdoc
rbenv rehash
bundle -j 20
Run in terminal:
sudo -u postgres psql
CREATE ROLE "codestats" LOGIN CREATEDB PASSWORD 'codestats';
Log out from postgres and run:
bundle exec rake db:create db:migrate
Your server is ready to run. You can do this by executing rails server
and going to http://localhost:3000. Happy coding!
If you want to deploy your app using Heroku you need to do the following:
- Add the Heroku Git URL
- Push to heroku
- Run migrations
git remote add heroku-prod your-git-url
git push heroku-prod your-branch:master
The gems and files needed to make a deploy to AWS with Capistrano are included in this repo but commented. Feel free to use them.
Rollbar is used for exception errors report. To complete this configuration setup the following environment variables in your server:
ROLLBAR_ACCESS_TOKEN
with the credentials located in the rollbar application.ROLLBAR_ENVIRONMENT
with the environment name you want to be shown in Rollbar. This is usefull if you have different servers running in Production mode and you want to identify them in Rollbar.
Set the GOOGLE_ANALYTICS_TOKEN
environment variable in your server.
You can use either environment variables or the secrets.yml. If you want to set environment variables in development you can add them to .env.local (you can find an example in the .env.local.example file.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Run rspec tests (
bundle exec rspec spec -fd
) - Run rubocop lint (
bundle exec rubocop app spec -R
) - Push your branch (
git push origin my-new-feature
) - Create a new Pull Request
Feel free to add a new Issue by clicking here if you find a bug, idea of improvement, etc.
This project is maintained by: