Home » Archives for Patroklos Papapetrou » Page 2

Author Archives: Patroklos Papapetrou

Patroklos is an experienced JavaEE Software Engineer and an Agile enthusiast seeking excellence in software quality. He is also co-Author of the Sonar in Action book, and contributor of several Sonar plugins.

Avoiding Null Checks In Java

One of the worst nightmares for java developers ( from junior to experts ) is null object reference checking. I’m pretty sure you have seen several times code like this:                   public void addAddressToCustomer(Customer customer, Address newAddress){ if ( cutomer == null || newAddress == null) return; if ( customer.getAddresses() == null ...

Read More »

Avoiding Many If Blocks For Validation Checking

There are cases that we want to validate input data before we send them to business logic layer for processing, computations etc. This validation, in most cases, is done in isolation or it might include some cross-checking with external data or other inputs. Take a look at the following example that validates user input for registration data.         ...

Read More »

SonarQube As An Education Platform

I’ve been using SonarQube [1] platform for more than four years. I remember the time when it was making its first baby steps as a code quality management tool. It looked more like a system that was integrated with various third-party static analysis tools (like PMD, FindBugs etc.) and provided a few but important code quality metrics. Many things changed over the ...

Read More »

Rest API best(?) practices reloaded

The last one and a half year I’m involved in 2-3 projects that expose a big set of Rest APIs for “external” use. I will come back later and explain why the word external is insides quotes. During this period we had to design, re-design and re-structure some times these APIs. This blog post expresses my personal thoughts about some best(?) practices that ...

Read More »

To SonarQube or not to SonarQube?

This is the first question that a team leader, s/w director, customer, developer, architect, tester or whatever role exists in a development team should ask. It’s not yet another question about using another “quality tool”. You already have plenty of them installed. This is not a simple question to see how much you care about test coverage or to find ...

Read More »

My advice to (junior) developers about their career

The last couple of months I have met several young developers that either looking for the first job or are still trying to get their bachelor degree. Many of them asked me to give them my advice on how they can make their first steps in the software development career. It’s really nice to see young people to care so ...

Read More »

Fixing common Java security code violations in Sonar

This article aims to show you how to quickly fix the most common java security code violations. It assumes that you are familiar with the concept of code rules and violations and how Sonar reports on them. However, if you haven’t heard these terms before then you might take a look at Sonar Concepts or the forthcoming book about Sonar ...

Read More »

Sonar’s Quality Alphabet

Sonar (by SonarSource.com) is getting more and more popular among developer teams. It’s an open source platform measuring software quality in the following 7 axes Architecture and Design  Comments  Coding Rules  Complexity  Code Duplication  Potential Bugs  Unit Tests  If you’re a Sonar newbie then you might find this blog post very useful. On the other hand if you’re an experienced ...

Read More »