<< Previous | Home

Git Stash pull request alias

Google +1

fetch pull request -> checkout -> rebase from master

Sometimes it is usefull to create an alias for pull request code review:

You should add alias to your .gitconfig file. (WIndows location for .gitconfig is your user folder)

 

[alias] pr = "!f() { git fetch -fu ${2:-upstream} refs/pull-requests/$1/from:pr-$1 && git checkout pr-$1 && git fetch --all && git rebase upstream/master ; }; f"

Read more...

Code Review Checklist

Google +1

Code Review Checklist

Code Review Checklist

General

  • Does the code work? Does it perform its intended function, the logic is correct etc.
  • Is all the code easily understood?
  • Does it conform to your agreed coding conventions? These will usually cover location of braces, variable and function names, line length, indentations, formatting, and comments.
  • Is there any redundant or duplicate code?
  • Is the code as modular as possible?
  • Can any global variables be replaced?
  • Is there any commented out code?
  • Do loops have a set length and correct termination conditions?
  • Can any of the code be replaced with library functions?
  • Can any logging or debugging code be removed?

Security

  • Are all data inputs checked (for the correct type, length, format, and range) and encoded?
  • Where third-party utilities are used, are returning errors being caught?
  • Are output values checked and encoded?
  • Are invalid parameter values handled?

Documentation

    integration testing

     

  • Do comments exist and describe the intent of the code?
  • Are all functions commented?
  • Is any unusual behavior or edge-case handling described?
  • Is the use and function of third-party libraries documented?
  • Are data structures and units of measurement explained?
  • Is there any incomplete code? If so, should it be removed or flagged with a suitable marker like ‘TODO’?

Testing

  • Is the code testable? i.e. don’t add too many or hide dependencies, unable to initialize objects, test frameworks can use methods etc.
  • Do tests exist and are they comprehensive? i.e. has at least your agreed on code coverage.
  • Do unit tests actually test that the code is performing the intended functionality?
  • Are arrays checked for ‘out-of-bound’ errors?
  • Could any test code be replaced with the use of an existing API?

Read more...

Spring Boot and Akka

Google +1

Spring Akka example

 Reading something about Java and the Actor model will sooner or later lead toAkka. There is a great documentation for the Scala and Java API to get started with the Akka toolkit. This application is an experiment to create a small example of the Java API in combination with the Spring Framework.

The application should spawn some actors to asynchronously write several messages in a database and shut down after all messages are processed.

Spring Boot is used to simplify the test application configuration, including packaging and startup/shutdown behaviour. See the repository for class imports and more code comments.

Read more...

Lombok project usage expirience

Google +1

Reducing Boilerplate Code with Project Lombok

Recently I was reccomended to use Lombok project. I  didn't have a chace  to look into it earlier. When I managed I was excited with it. All boring operations like getters/setters/ logger/toString/equals/hashCode that you had to complete each time you create a new class were simplifed into several annotations. 

I am fan of clean and clear code writing and this framework helps a lot  with that. Project is available in maven repository. The good news for thouse who uses IntellijIdea - lombok plugin is also in place. 

See the complete list of supported features:

 

Read more...