Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- defmodule CredoBugOnABC do
- """
- This is an interactive bug report :)
- Load it on IEx.
- """
- def test() do
- code1 = ~s{
- def foo(a, b) do
- other_fun a, b
- end
- }
- code2 = ~s{
- def foo(a, b) do
- other_fun
- end
- }
- ast1 = Code.string_to_quoted! code1
- ast2 = Code.string_to_quoted! code2
- IO.puts "This is a bug report.\n"
- IO.puts "The following code has a function call:"
- IO.puts code1
- abc1 = Credo.Check.Refactor.ABCSize.abc_size_for ast1
- IO.puts "But its ABC size is measured as #{abc1}.\n"
- IO.puts "In comparison, try the following code:"
- IO.puts code2
- abc2 = Credo.Check.Refactor.ABCSize.abc_size_for ast2
- IO.puts "And its ABC size is measured correctly as #{abc2}.\n"
- end
- end
Add Comment
Please, Sign In to add comment