Ok, kibit is definitely what I was looking for. 
https://github.com/jonase/kibit 
Just doing a lein kibit on my projects, I quickly got some interesting 
stuff.

There are more functions that I forgot about than things I can learn so far 
but that's still very useful.
Just for informations, I encountered the same issues in every of my project 
:

   - I often uses (if x x y) instead of (or x y). I think that's the 
   dumbest one.
   - Some if that can be replaced with when
   - I often miss functions on numbers: inc, dec and zero?
   - Useless usage of -> after refactoring
   - The only thing I would not change so far was (when-not (empty? x)) ==> 
   (when (seq x)) because even knowing how seq works, I feel it can be 
   confusing later on.

I unfortunately run into https://github.com/jonase/kibit/issues/14 where 
namespace 
qualified keywords with aliases triggers Exceptions (::f/something)
but I needed an overall understanding of my mistakes and discover new fns 
so that's no big deal for me

On a side note, thanks for 
pointing 
http://jafingerhut.github.io/cheatsheet/clojuredocs/cheatsheet-tiptip-cdocs-summary.html
 
. I only used clojure docs or repl doc but I'll be faster in some cases 
with the cheatsheet tooltips.

http://blog.mattgauger.com/blog/2014/09/15/clojure-code-quality-tools/ is 
also very interesting with explanations on other analysis tools

On Thursday, March 3, 2016 at 7:33:55 PM UTC+1, Jeremy Vuillermet wrote:
>
> Hello,
>
> Every time I go to a code base I don't know, I discover new functions from 
> clojure api that I was not aware of. 
> Those are usually simple shortcut functions that don't do much but make 
> the code shorter.
>
> Just doing a research on this group for "shorter code" and "better code" 
> there are some cases like that.
> For example (first (first mycoll)) can be shortened with (ffirst mycoll). 
> There are so many place, as a relatively new clojure programmer, where I 
> could shorten code like that.
>
> So my question is : Do we have a tool where we can copy/paste some code or 
> link github repo to find those opportunities for improvement.
>
> If no, would it be hard to make such a tool ? Does this need regex or 
> dealing with the ast ?
>
> Thanks
> Jeremy
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to