Coder Social home page Coder Social logo

bugspots's Introduction

Bugspots - Bug Prediction Heuristic

An implementation of the simple bug prediction heuristic outlined by the Google Engineering team: Bug Prediction at Google

Well, we actually have a great, authoritative record of where code has been requiring fixes: our bug tracker and our source control commit log! The research indicates that predicting bugs from the source history works very well, so we decided to deploy it at Google.

Point bugspots at any git repo and it will identify the hotspots for you.

Usage

$> gem install bugspots
$> bugspots /path/to/repo
$> git bugspots (in root of current git project, --help for options)

Results

$> cd /your/git/repo
$> git bugspots -d 500

  .. example output ..

	Scanning /git/eventmachine repo
	Found 31 bugfix commits, with 23 hotspots:

	Fixes:
		- Revert "Write maximum of 16KB of data to an SSL connection per tick (fixes #233)" for #273
		- Do not close attached sockets (fixes #200)
		- Write maximum of 16KB of data to an SSL connection per tick (fixes #233)
		- Merge branch 'master' into close_schedule_fix
		- Remove dependency on readbytes.rb for ruby 1.9 (fixes #167, #234)
		- Fix compilation on MSVC2008 (fixes #253)
		- EM::Deferrable#(callback|errback|timeout) now return self so you can chain them (closes #177)
		- Make EventMachine::Connection#get_peername and #get_sockname valid for IPv6 (closes #132)
		- reconnect DNS socket if closed
		- Use String#bytesize in EM::Connection#send_datagram for 1.9 (closes #153)
		- Fix an issue that would cause the EM process to block when the loopbreak pipe filled up (closes #158)
		- namespace std is already included, so just call min(). fixes vc6 issue with min macro
		- Use close() instead of closesocket() to prevent FD leaks on windows.
		- Stop advertising non-available authentication mechanisms, allow multi-line authentication - fixes compatibility with javamail
		- typo fixes and undef fstat for ruby on Windows
		- Deprecate now aged info, as it's fixed
		- Some fixes for Solaris and Nexenta (opensolaris kernel + linux userland)
		- Some fixes for solaris
		- Minor fixes for rbx compatibility
		- Reduce the size of the RunEpollOnce stack frame by 800kb. This fixes the long-standing epoll+threads issue (#84)
		- Fixed aggregated event handling for kqueue and notify, fixed path for ifconfig.
		- More win32 fixes
		- Added test for reactor_thread? and fixed up EM.schedule for pre-reactor schedules
		- Merge branch 'master' of [email protected]:eventmachine/eventmachine
		- Use read instead of recv in ConnectionDescriptor::Read (fixes EM.attach issues with pipes)
		- Use false to indicated a cancelled timer instead of using an empty proc. Reduces mem usage in certain situations.
		- Inotify fixes: file_delete only fires after fds have been closed, use syscall hackery for older linux distributions (*cough* debian)
		- Clean up deferrable.rb: fixed rdoc, alias method wrappers, remove unnecessary forwardable
		- More solaris build fixes.
		- More solaris build issues fixed
		- fixed a small bug with basic auth (cherry-pick conflict merge from mmmurf (closes #92))

	Hotspots:
		0.9723 - ext/ed.cpp
		0.3311 - ext/ed.h
		0.3271 - ext/em.cpp
		0.3034 - lib/eventmachine.rb
		0.2433 - lib/em/protocols/postgres3.rb
		0.2403 - ext/project.h
		0.0431 - lib/em/deferrable.rb
		0.029 - ext/cmain.cpp
		0.0278 - ext/rubymain.cpp
		0.0277 - ext/eventmachine.h
		0.0241 - lib/em/resolver.rb
		0.0241 - tests/test_resolver.rb
		0.0225 - lib/em/connection.rb
		0.0013 - lib/em/protocols/smtpserver.rb
		0.0003 - ext/extconf.rb
		0.0002 - tests/test_basic.rb
		0.0001 - ext/em.h
		0.0001 - ext/cplusplus.cpp
		0.0001 - ext/fastfilereader/extconf.rb
		0.0 - lib/em/filewatcher.rb
		0.0 - tests/test_file_watch.rb
		0.0 - ext/fastfilereader/mapper.cpp
		0.0 - lib/protocols/httpclient.rb

License

(MIT License) - Copyright (c) 2011 Ilya Grigorik

bugspots's People

Contributors

airblade avatar bittersweet avatar giwa avatar gmvdm avatar hokuma avatar igrigorik avatar markmcspadden avatar msgerbush avatar niwatolli3 avatar nono avatar philipp-classen avatar rbxbx avatar rumpl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bugspots's Issues

crash - stack trace

Hi

I am trying this utility and I was wondering what the issue might be

C:\Ruby192>bugspots p:\projects\opencover.git\working
Scanning p:\projects\opencover.git\working repo
C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/process.rb:290:in `spawn
': can't convert nil into String (TypeError)
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/process.rb:
290:in `spawn'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/process.rb:
271:in `popen4'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/process.rb:
97:in `exec!'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/process.rb:
68:in `initialize'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git.rb:301:
in `new'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git.rb:301:
in `native'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/git.rb:325:
in `method_missing'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/commit_stat
s.rb:39:in `find_all'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/repo.rb:352
:in `commit_stats'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/grit-2.4.1/lib/grit/commit.rb:2
24:in `stats'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bugspots-0.0.4/lib/bugspots/sca
nner.rb:20:in `block in scan'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bugspots-0.0.4/lib/bugspots/sca
nner.rb:18:in `each'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bugspots-0.0.4/lib/bugspots/sca
nner.rb:18:in `scan'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bugspots-0.0.4/bin/bugspots:44:
in `<top (required)>'
        from C:/Ruby192/bin/bugspots:19:in `load'
        from C:/Ruby192/bin/bugspots:19:in `<main>'

C:\Ruby192>

Failure on a few Private Repos

BugSpots Fails with the following message on a few repos

Failed to run BugSpots: /var/lib/gems/2.3.0/gems/bugspots-0.2.2/lib/bugspots/scanner.rb:31:in `scan': undefined method `date' for nil:NilClass (NoMethodError)
	from /var/lib/gems/2.3.0/gems/bugspots-0.2.2/bin/bugspots:49:in `<top (required)>'
	from /usr/local/bin/bugspots:22:in `load'
	from /usr/local/bin/bugspots:22:in `<main>'

using the following command
git bugspots -b BranchName -d Depth

make error : undefined reference to `xxxxxx'

I tried to install bugports on Windows(MSYS2). However, I cannot install because of some compile error.

My Installation Instructions

  1. Install MSYS2.
  2. run msys2_shell.bat and
pacman -S mingw-w64-i686-ruby mingw-w64-x86_64-ruby mingw-w64-i686-clang mingw-w64-x86_64-clang mingw-w64-i686-libxml2 mingw-w64-x86_64-libxml2 libxml2 mingw-w64-i686-cmake mingw-w64-x86_64-cmake cmake
  1. run mingw64_shell.bat and
gem install bugspots

error

current directory: D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged
D:/msys64/mingw64/bin/ruby.exe -r ./siteconf20160406-14748-10fbth3.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... yes
 -- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles"
 -- D:\msys64\usr\bin/make.exe
checking for main() in -lgit2... yes
checking for git2.h... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  D:/msys64/mingw64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/rugged-0.24.0/mkmf.log

current directory: D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged
make "DESTDIR=" clean

current directory: D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged
make "DESTDIR="
generating rugged-x64-mingw32.def
compiling rugged.c
compiling rugged_backend.c
compiling rugged_blame.c
compiling rugged_blob.c
compiling rugged_branch.c
compiling rugged_branch_collection.c
compiling rugged_commit.c
compiling rugged_config.c
compiling rugged_cred.c
compiling rugged_diff.c
compiling rugged_diff_delta.c
compiling rugged_diff_hunk.c
compiling rugged_diff_line.c
compiling rugged_index.c
compiling rugged_note.c
compiling rugged_object.c
compiling rugged_patch.c
compiling rugged_rebase.c
compiling rugged_reference.c
compiling rugged_reference_collection.c
compiling rugged_remote.c
compiling rugged_remote_collection.c
compiling rugged_repo.c
compiling rugged_revwalk.c
compiling rugged_settings.c
compiling rugged_signature.c
compiling rugged_submodule.c
compiling rugged_submodule_collection.c
compiling rugged_tag.c
compiling rugged_tag_collection.c
compiling rugged_tree.c
linking shared-object rugged/rugged.so
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(filebuf.c.obj): In function `write_deflate':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/filebuf.c:171: undefined reference to `deflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(filebuf.c.obj): In function `git_filebuf_cleanup':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/filebuf.c:118: undefined reference to `deflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(filebuf.c.obj): In function `git_filebuf_open':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/filebuf.c:308: undefined reference to `deflateInit_'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(odb_loose.c.obj): In function `finish_inflate':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:212: undefined reference to `inflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:214: undefined reference to `inflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(odb_loose.c.obj): In function `read_header_loose':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:444: undefined reference to `inflateInit_'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:449: undefined reference to `inflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(odb_loose.c.obj): In function `inflate_buffer':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:245: undefined reference to `inflateInit_'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:251: undefined reference to `inflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:253: undefined reference to `inflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(odb_loose.c.obj): In function `start_inflate':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:201: undefined reference to `inflateInit_'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:204: undefined reference to `inflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(odb_loose.c.obj): In function `inflate_tail':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:292: undefined reference to `inflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/odb_loose.c:277: undefined reference to `inflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(pack.c.obj): In function `packfile_unpack_compressed':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/pack.c:873: undefined reference to `inflateInit_'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/pack.c:884: undefined reference to `inflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/pack.c:899: undefined reference to `inflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/pack.c:891: undefined reference to `inflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(pack.c.obj): In function `git_packfile_stream_open':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/pack.c:796: undefined reference to `inflateInit_'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(pack.c.obj): In function `git_packfile_stream_read':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/pack.c:822: undefined reference to `inflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(pack.c.obj): In function `git_packfile_stream_free':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/pack.c:847: undefined reference to `inflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(zstream.c.obj): In function `git_zstream_init':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/zstream.c:33: undefined reference to `deflateInit_'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(zstream.c.obj): In function `git_zstream_reset':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/zstream.c:44: undefined reference to `deflateReset'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(zstream.c.obj): In function `git_zstream_get_output':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/zstream.c:100: undefined reference to `deflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/zstream.c:100: undefined reference to `deflate'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(zstream.c.obj): In function `git_zstream_free':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/zstream.c:39: undefined reference to `deflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/zstream.c:39: undefined reference to `deflateEnd'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(indexer.c.obj): In function `crc_object':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/indexer.c:246: undefined reference to `crc32'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/indexer.c:253: undefined reference to `crc32'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(indexer.c.obj): In function `hash_and_save':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/indexer.c:388: undefined reference to `crc32'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(indexer.c.obj): In function `inject_object':
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/indexer.c:706: undefined reference to `crc32'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/indexer.c:714: undefined reference to `crc32'
D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/ext/rugged/../../vendor/libgit2/build/libgit2.a(indexer.c.obj):D:/msys64/mingw64/lib/ruby/gems/2.3.0/gems/rugged-0.24.0/vendor/libgit2/src/indexer.c:724: more undefined references to `crc32' follow
collect2.exe: error: ld returned 1 exit status
Makefile:254: ターゲット 'rugged.so' のレシピで失敗しました
make: *** [rugged.so] エラー 1

make failed, exit code 2

Env

$ gcc --version
gcc.exe (Rev4, Built by MSYS2 project) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [x64-mingw32]
$ cmake --version
cmake version 3.4.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ make --version
GNU Make 4.1
このプログラムは x86_64-pc-msys 用にビルドされました
Copyright (C) 1988-2014 Free Software Foundation, Inc.
ライセンス GPLv3+: GNU GPL バージョン 3 以降 <http://gnu.org/licenses/gpl.html>
これはフリーソフトウェアです: 自由に変更および配布できます.
法律の許す限り、 無保証 です.
$ git --version
git version 2.7.4

This doesn't work with single branch, which is not master

bash-3.2$ git bugspots
Scanning /Users/aaa/GitHub/service repo
/usr/local/lib/ruby/gems/2.4.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:13:in scan': no such branch in the repo: master (ArgumentError) from /usr/local/lib/ruby/gems/2.4.0/gems/bugspots-0.2.1/bin/bugspots:52:in <top (required)>'
from /usr/local/bin/bugspots:22:in load' from /usr/local/bin/bugspots:22:in

'
bash-3.2$ git branch

  • develop
    bash-3.2$ git checkout -B master
    Switched to a new branch 'master'
    bash-3.2$ git branch
    develop
  • master
    bash-3.2$ git bugspots
    Scanning /Users/aaaa/GitHub/service repo
    Found xxx bugfix commits, with xxx hotspots:

Invalid byte code issue

Getting below failure on our code base .. Same stuff is working on smaller and other projects

bugspots /Users/sumitnagal/dev/src/ -b develop
Scanning /Users/sumitnagal/dev/src/ repo
/usr/local/lib/ruby/gems/2.4.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:20:in =~': invalid byte sequence in UTF-8 (ArgumentError) from /usr/local/lib/ruby/gems/2.4.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:20:in block in scan'
from /usr/local/lib/ruby/gems/2.4.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:19:in each' from /usr/local/lib/ruby/gems/2.4.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:19:in scan'
from /usr/local/lib/ruby/gems/2.4.0/gems/bugspots-0.2.1/bin/bugspots:52:in <top (required)>' from /usr/local/bin/bugspots:22:in load'
from /usr/local/bin/bugspots:22:in `

'

This doesn't support help option and failing on few projects with below Error

bash-3.2$ git bugspots --help
No manual entry for git-bugspots

mtvd125a0000% git-bugspots
Scanning /Users/aaaa/dev/project/src repo
/usr/local/lib/ruby/gems/2.3.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:20:in =~': invalid byte sequence in UTF-8 (ArgumentError) from /usr/local/lib/ruby/gems/2.3.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:20:in block in scan'
from /usr/local/lib/ruby/gems/2.3.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:19:in each' from /usr/local/lib/ruby/gems/2.3.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:19:in scan'
from /usr/local/lib/ruby/gems/2.3.0/gems/bugspots-0.2.1/bin/bugspots:52:in <top (required)>' from /usr/local/bin/bugspots:23:in load'
from /usr/local/bin/bugspots:23:in `

'

Should Use Last Commit Date not Current Time

To calculate the timestamp, it would probably be better to use the time of the last fix.date instead of Time.now. This way the hotspot values will not change over time, only on new commits.

0.2.0 does not terminate on itself

Running bugspots on its own repository (master 2014-07-01) does not terminate. Meaningful results are printed, though.

Terminates on other repositories (e.g. rugged).

mint 16, ruby 1.9.1

Add No Merges Option

Removing merges from the commit history should give more relevant results for a given depth.

Grit allows native git commands, so this can be done by just passing options to rev-list and then parsing the list of commits.

Using depth parameter does not work

git bugspots -d 2000 yields this error when used on gnome/evolution repo:

[m0hawk@m0hawkPC evolution]$ git bugspots -d 2000
Scanning /home/m0hawk/Documents/bachelorthesis/evolution -d 2000 repo
/home/m0hawk/.gem/ruby/2.3.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:11:in `new': Failed to resolve path '/home/m0hawk/Documents/bachelorthesis/evolution -d 2000': No such file or directory (Rugged::OSError)
    from /home/m0hawk/.gem/ruby/2.3.0/gems/bugspots-0.2.1/lib/bugspots/scanner.rb:11:in `scan'
    from /home/m0hawk/.gem/ruby/2.3.0/gems/bugspots-0.2.1/bin/bugspots:52:in `<top (required)>'
    from /home/m0hawk/.gem/ruby/2.3.0/bin/bugspots:23:in `load'
    from /home/m0hawk/.gem/ruby/2.3.0/bin/bugspots:23:in `<main>'

Stack trace when I run against my repo

mwarkentin@Michaels-MacBook-Air wa (iteration-1.16) $ bugspots /Users/mwarkentin/WaveAccounting/wa
Scanning /Users/mwarkentin/WaveAccounting/wa repo
/Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:198:in `find_object_in_index': stack level too deep (SystemStackError)
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:233:in `find_object'
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:70:in `with_idx'
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:232:in `find_object'
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/internal/pack.rb:115:in `[]'
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:78:in `get_raw_object_by_sha1'
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:77:in `each'
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:77:in `get_raw_object_by_sha1'
    from /Library/Ruby/Gems/1.8/gems/grit-2.4.1/lib/grit/git-ruby/repository.rb:105:in `get_object_by_sha1'
     ... 1338 levels...
    from /Library/Ruby/Gems/1.8/gems/bugspots-0.0.1/lib/bugspots/scanner.rb:12:in `scan'
    from /Library/Ruby/Gems/1.8/gems/bugspots-0.0.1/bin/bugspots:18
    from /usr/bin/bugspots:19:in `load'
    from /usr/bin/bugspots:19

Add license

How is this licensed? Can we use it freely?

Integrate better with Git

If you rename the executable to ex. git-bugspots and put it in the path, the main git-program will integrate with it.

Ex. try putting git-helloworld somewhere in your path:

#!/bin/sh
echo "Hello, Git"

And then run it though git:

> git helloworld
Hello, Git

Feature request: Specify a directory that isn't root

I have a large project, where I only want to see bug spots in one of the subdirectories, but when I tried running bugspots -b mybranch ./directory I got the error Invalid Git repository - please run from or specify the full path to the root of the project.. I can look into adding this feature next week, but was wondering if anyone else thinks this would be useful? Is this repo open to outside contributors?

rainbow related errors when run with ruby 2.0.0p451

Seeing an error when run bugspots on ruby 2.0.0p451

*** LOCAL GEMS ***
bugspots (0.1.2)
rainbow (2.0.0)
rake (0.9.6)
...

bin$ bugspots demo
/Library/Ruby/Gems/2.0.0/gems/bugspots-0.1.2/bin/bugspots:47:in <top (required)>': undefined methodforeground' for "Scanning demo repo":String (NoMethodError)
from /usr/bin/bugspots:23:in load' from /usr/bin/bugspots:23:in

'

/usr/bin/bugspots:6:in `require': no such file to load -- bugspots (LoadError)

After installing and linking to the executable:
gem install bugspots
gem install rainbow # This should be listed in dependencies?
ln -s /var/lib/gems/1.8/gems/bugspots-0.0.1/bin/bugspots /usr/bin/bugspots

I get this error:
/usr/bin/bugspots:6:in `require': no such file to load -- bugspots (LoadError)
from /usr/bin/bugspots:6

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.