Giter VIP home page Giter VIP logo

rubytt's Introduction

Rubytt

Build Status

Synopsis

Rubytt is a static Ruby code analyzer, optimized especially for Rails app.

  1. The basic ideas comes from rubysonar, but with more help from analysis of db/schema.rb, we may get more accurate types for the code annotation or bug finding.

  2. Do some visualizations for the class/db/model.

  3. Check the unused variable, this may reported out some bugs, ruby-lint seems can report out these errors, but it's too slow.

  4. Check the undefined error [PARTLY FINISHED]

  5. Check the type mismatch error [TODO]

  6. The project is in experimental status. It's written in OCaml.

to be finished ....

For Users

Install

rubytt can be installed using OCaml package manager:

Linux

gem install parallel ruby-progressbar
sudo apt-get install --force-yes ocaml ocaml-native-compilers camlp4-extra opam
opam init
eval `opam config env`
opam install rubytt

Mac

gem install parallel ruby-progressbar
brew install opam
opam init
eval `opam config env`
opam install rubytt

Usage

rubytt -h   ## see the help messages
rubytt -s source_dir -t type -o res       ## analysis type for source_dir, dump html in res directory
rubytt -s source_dir -t class -o res.png  ## analysis class for source_dir, dump out result to res.png
rubytt -s source_dir -t db -o res.png     ## analysis db for source_dir, dump out result to res.png
rubytt -s source_dir -t model -o res.png  ## analysis model for source_dir, dump out result to res.png
rubytt -s source_dir -t check             ## try find unused or undef variable bugs

How to compile:

gem install parallel ruby-progressbar

// Linux:
sudo apt-get install --force-yes ocaml ocaml-native-compilers camlp4-extra opam

// Mac:
brew install opam

opam init -y
opam update
opam switch 4.02.1
opam install core yojson alcotest ounit stringext -y
eval `opam config env`

brew install graphviz ## ignore it if installed

make  ## or use: make native

rubytt's People

Contributors

chenyukang avatar yukangchen avatar

Stargazers

Patrick Cieplak avatar Honwhy Wang avatar Ritchie Young avatar Max Surkov avatar adslyw avatar Albert avatar Thomas Gazagnaire avatar Gábor Nagymajtényi avatar Chou S. avatar Igor Fedoronchuk avatar Alexandru Leasenco avatar Anton Davydov avatar Seb Mondet avatar Xavier Van de Woestyne avatar Che Chaoyang avatar  avatar

Watchers

 avatar  avatar James Cloos avatar Ye Zhaoliang avatar  avatar

rubytt's Issues

global variable issues

$gvar = "I'm a global!"
class C
    def examine_global
        puts $gvar
    end
end

c = C.new
c.examine_global # I'm a global!

star issues

a = [1, 2]

def demo_func a, b

end

demo_func(*a)

ensure bug

  def perform(operator_id = nil)
    w = Warehouse.find_by_code(Warehouse::TM)
    log = w.logs.create!(note: jid, operator_id: operator_id)
  ensure
    log && log.done!
  end

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.