Quantcast
Channel: code patterns – Codacy | Blog
Browsing all 8 articles
Browse latest View live

Why use Try instead of try/catch

When writting Scala code, you always have the ability to use Java like exception control flows using try and catch. However, you have the option of start using the Try type. Why use Try vs try/catch?...

View Article


Difference between private and private[this]?

When using private and private[this] do you know the difference? When adding the scope to the private modifier (private[X]), it effectively behaves as a “up to” X, where X designates some enclosing...

View Article


One less Exception

java.util.NoSuchElementException: No value found for 'USD' at scala.Enumeration.withName(Enumeration.scala:124) Dammit! I hate it when code blows in production. For some cases there’s just no tests or...

View Article

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...

View Article

9 Scala security issues you should know about

Here is a list of 9 security issues we feel every Scala developer should know about and try to avoid:   1. Avoid Object deserialization of untrusted data Object deserialization of untrusted data can...

View Article


Image may be NSFW.
Clik here to view.

Codacy integrates with ESLint

This past year we’ve seen an incredible growth coming from ESLint. ESLint is a linter on steroids for ECMAScript, JSX and JavaScript code. It quickly became the go-to linter for the JavaScript...

View Article

Image may be NSFW.
Clik here to view.

Review of CSS Linting Tools

Writing a set of well-structured and optimized CSS codes can be a tedious task. There are a couple of tools you could use today to help you achieve better CSS code. CSS Linting Tools will assist you...

View Article

Image may be NSFW.
Clik here to view.

3 new code patterns for Scala

Codacy regularly adds new patterns to the languages it supports. Here are 3 new patterns we just added for Scala: 1. Avoid using DateTime.now without a timezone (Error Prone) Using DateTime.now without...

View Article

Browsing all 8 articles
Browse latest View live