We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As far as I've seen, is not possible to output the result in a machine parseable format yet.
For instance, running flay -# -d lib/*.rb in this project outputs:
flay -# -d lib/*.rb
$ flay -# -d lib/*.rb Total score (lower is better) = 72 Similar code found in :iter (mass = 36) A: lib/flay.rb:74 B: lib/flay.rb:99 A: opts.on("-m", "--mass MASS", Integer, "Sets mass threshold (default = #{options[:mass]})") do |m| B: opts.on("-t", "--timeout TIME", Integer, "Set the timeout. (default = #{options[:timeout]})") do |t| A: options[:mass] = m.to_i B: options[:timeout] = t.to_i end Similar code found in :defn (mass = 36) A: lib/flay_erb.rb:28 B: lib/flay_erb.rb:36 A: def add_expr_literal(src, code) B: def add_expr_escaped(src, code) if code.=~(BLOCK_EXPR) then A: ((src << "@output_buffer.append= ") << code) B: ((src << "@output_buffer.safe_append= ") << code) else A: (((src << "@output_buffer.append=(") << code) << ");") B: (((src << "@output_buffer.safe_append=(") << code) << ");") end end
Something like this would be useful for parsing (JSON example, XML or YAML would also be valid):
{ "total": 72, "clones": [ { "match": ":iter", "mass": 36, "A": { "filename": "lib/flay.rb", "line": 74 }, "B": { "filename": "lib/flay.rb", "line": 99 }, "lines": [ { "source": "A", "content": "opts.on("-m", "--mass MASS", Integer, "Sets mass threshold (default = #{options[:mass]})") do |m|" }, { "source": "B", "content": "opts.on("-t", "--timeout TIME", Integer, "Set the timeout. (default = #{options[:timeout]})") do |t|" }, { "source": "A", "content": " options[:mass] = m.to_i" }, { "source": "B", "content": " options[:timeout] = t.to_i" }, { "source": "Common", "content": " end" } ] }, { "match": ":defn", "mass": 36, "A": { "filename": "lib/flay_erb", "line": 28 }, "B": { "filename": "lib/flay_erb", "line": 36 }, "lines": [ { "source": "A", "content": "def add_expr_literal(src, code)" }, { "source": "B", "content": "def add_expr_escaped(src, code)" }, { "source": "Common", "content": " if code.=~(BLOCK_EXPR) then" }, { "source": "A", "content": " ((src << "@output_buffer.append= ") << code)" }, { "source": "B", "content": " ((src << "@output_buffer.safe_append= ") << code)" }, { "source": "Common", "content": " else" }, { "source": "A", "content": " (((src << "@output_buffer.append=(") << code) << ");")" }, { "source": "B", "content": " (((src << "@output_buffer.safe_append=(") << code) << ");")" }, { "source": "Common", "content": " end" }, { "source": "Common", "content": " end" } ] } ] }
Would anyone oppose to this? If no one opposes I'm willing to start the feature and do the PR
The text was updated successfully, but these errors were encountered:
there's a PR waiting for review for a while. Actually there's one for json ( #57 ) and one for xml ( #59 )
Sorry, something went wrong.
zenspider
Successfully merging a pull request may close this issue.
As far as I've seen, is not possible to output the result in a machine parseable format yet.
For instance, running
flay -# -d lib/*.rb
in this project outputs:Something like this would be useful for parsing (JSON example, XML or YAML would also be valid):
Would anyone oppose to this? If no one opposes I'm willing to start the feature and do the PR
The text was updated successfully, but these errors were encountered: