Giter VIP home page Giter VIP logo

project_metric_code_climate's Introduction

Code Climate Project Metrics

Defines scalar and image for CodeClimate Project Metrics

 # Gemfile

 gem 'project_metric_code_climate', git: 'https://github.com/AgileVentures/project_metric_code_climate'
 gem 'project_metrics', git: 'https://github.com/AgileVentures/ProjectMetrics/'
# main.rb

require 'project_metrics'
ProjectMetrics.configure do 
  add_metric :project_metric_code_climate
end

ProjectMetrics.metric_names # => ["project_metric_code_climate"]

ProjectMetrics.class_for('code_climate')
ProjectMetricCodeClimate

sample_point = ProjectMetrics.class_for('code_climate').new url: 'http://github.com/AgileVentures/WebsiteOne'
#<ProjectMetricCodeClimate:0x007fd2428700c0 @identifier="github/AgileVentures/WebsiteOne", @raw_data=nil>

sample_point.score # => 3.5

sample_point.image # => "https://codeclimate.com/github/AgileVentures/WebsiteOne/badges/gpa.svg"

Here we have some preexisting raw data in raw_data that would be used to compute a gpa of 3.2:

sample_point.raw_data = raw_data

sample_point.score # =>  3.2

Then we refresh, calling out to the network

sample_point.refresh # => true

And we're back to live data of 3.5

sample_point.score # => 3.5

Required Configuration Variable

  • url: URL of the GitHub repository.

TODO

  • make sure that image uses raw_data
  • could refactor code to memo-ize raw_data reader
  • handling network errors - just let them propogate up?

project_metric_code_climate's People

Contributors

tansaku avatar mtc2013 avatar an-ju avatar shuotong avatar

Watchers

James Cloos avatar João Pereira avatar Bryan Yap avatar  avatar Raoul DIFFOUO avatar Thomas Ochman avatar  avatar

Forkers

an-ju shuotong

project_metric_code_climate's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.