1500x500

Codacy at the Tricity Scala Users Group

Last week we attended the Tricity Scala Users Group scala meetup where I did a short presentation about Codacy’s project structure and architecture. This blog post is a quick summary of the presentation I made. The slides are available here, or you can download them directly as a pdf here if you prefer.

600_439600154-2

 

I would like to thank Scalac and Sandra, our Developer Advocate, for the organization of the event. Patryk Jażdżewski also made a presentation about how to use Scala on Android with Scaloid. You can check his slides here.

(more…)

Read More

Codacy Background Image

Why we chose Scala

We truly love Scala. Scala has been one of the pillars of Codacy from the start. Joao, who has an Enterprise Java background, has loved the language from the beginning and we’ve since taught Scala to new people joining in the company.

Why?

Initially, we wanted to have the expression power of dynamic languages without losing static type safety. We placed our bets on Scala and, judging from adoption rates, we believe this was a good decision. The type system is turing complete. This should say enough about its potential.

Scala has also helped us with hiring; typically, if someone is interested in working with Scala, they will probably be a good fit for us as a company. This is because a special spark in a engineer is needed for him/her to be curious and interested in working with new languages. Having said that, Scala is no longer a new language. Its adoption has been growing steadily and fueled by the big data movement and platforms such as Spark.

When defining Codacy’s architecture, we knew that the system we would have to build to analyze millions of lines of code per hour and would have to treat scalability, distribution and concurrency as first class citizens. We were already sold on Scala, since as I mentioned, we’ve been fans of the language for a long time. The process of choosing Play and Akka was simple: both are built for massive operations and have the backing of a strong growing company such as Typesafe. We treat every single operation as an immutable task for an actor. From parsing code, to dealing with code repositories, to applying code patterns to ASTs: everything is a task for us that we distribute to pools of actors. Akka excels at this job.

Now, we’re in a position where our current infrastructure demands further decomposition into services and that we break a monolith. Because we’ve modeled our system already in components, this has been easy from the architecture standpoint.

We are especially excited about the great work from the Scala team on Abide, Scala-Meta from Eugene Burmako and his team, and about the TASTY spec announced by Martin Odersky. It has many things we’ve been looking for to support customers interested in deeper code analysis.

Scala has been a great decision for us and it’s paying off in many ways.

 

 

Read More

bg-750x397

Codacy integrates with Atlassian Connect for Bitbucket

A few weeks ago the Bitbucket team approached us to become one of the first Bitbucket integrator on Atlassian Connect.
Today we are happy to announce that the Codacy add-on is available on Bitbucket!!

Atlassian Connect for Bitbucket?

Atlassian Connect for Bitbucket is the new (r)evolution for Bitbucket, which is used by over 3 million developers worldwide. It offers developers the possibility to integrate their tools directly and hassle-free into Bitbucket.

Why does it matter?

Developers are spending more and more time switching between tools instead of focusing on what really matters: coding. Atlassian Connect for Bitbucket removes the barriers to integrate and finally unify the tools into the development lifecycle.

At Codacy we are very excited about this new fully integrated Bitbucket. As a provider of an automated code review software our mission is to save time and frustrations out of the code review process. Being able to provide our results on the tools that our users are already using is a priority for us.

Today we are also happy to announce that Pull Requests will be fully supported on Bitbucket. We are already working on a few exciting features to complement this add-on. Stay tuned, add Codacy to your Bitbucket projects, and consider creating your own add-ons!

Read More

Codacy Background Image

Hello there, my name is Wolf

Hello there, my name is Sandra Wolf and I’m the new team member of Codacy (yay!)

photo

I have joined on the position of Developer Advocate, I will help you with all your #CodeReviews problems, and together we will take care of your technical debt. We will meet during tech conferences, meetups, user groups etc. I’m planning to be everywhere! I would love to help you make you as successful as possible using Codacy, and take advantage of everything that Codacy has to offer and make sure that you have fun using Codacy.

(more…)

Read More

Codacy Background Image

A quick look at scala.meta

At codacy we don’t only rely on external tools to find code patterns.

Especially when it comes to Scala we also have a nice repository of homemade patterns. Therefore we need to be able to process Scala sourcecode. And by processing we mainly mean transforming source code into Abstract Syntax Trees (ASTs).

Everything you find here you can try yourself in the repl. Be sure to add the following sbt resolver and dependencies

(Not yet deprecated) scala.reflect

Up until now we used the standard scala.reflect.api and the toolbox it provides. To parse scala code with help of the reflection toolbox we need to run the following:

The resulting tree variable is of type toolbox.u.Tree and this is the structure we use(d) to find problematic code. That doesn’t look too complicated you might say. Well you are right but the problems start here. Unfortunately those Trees are very complex (after all they represent the complete AST of your program). Also documentation is kinda poor – as writer of patterns I had to rely mainly on Scaladoc and partly Reflection.

Sidenote: Real life .scala files usually reside in packages which means a typical sourcefile will start with package foo ... The current implementation of the toolbox however is not able to parse such files. We were forced to implement a workaround that preyed on my mind ever since.

All of this doesn’t really make it easy for someone who doesn’t know the internals of scala.reflect.api to start writing patterns from scratch. But that’s exactly what we want. We want to make it possible for our users to write custom patterns for their issues.

scala.meta to the rescue

Recently we started a very promising collaboration with Eugene Burmako and Mathieu Demarne from scala.meta. scala.meta was created to simplify metaprograming in scala and will hopefully be the successor of the current scala.reflect. For us it already is. Let’s try to get a scala.meta.Tree (more…)

Read More