Using the Level metric to understand an existing code base

When we discuss the architecture of a code base, we often qualify a piece of a given code by using terms such as high level or low level. This is common vocabulary and we all intuitively know what it means. A piece of code A (whether it is a method, a class, a namespace, or an assembly) is considered as higher level than a piece of code B if A is using B while B doesn’t know about A. From this simple definition, we can order pieces of a code in our program as shown in the following diagram: Continue reading “Using the Level metric to understand an existing code base”

C/C++ SonarQube plugin based on Clang

The big challenge to develop a sonarqube plugin for C/C++ is to use the good parser, producing a parser for such a grammar is much harder.  What makes C++ really hard is certain rules relating to declarations/definitions, name lookup (consider argument-dependent name lookup) implicit conversion rules, and of course the resolution of templates. Continue reading “C/C++ SonarQube plugin based on Clang”

Search a specific treatments in your C/C++ source code

Searching in the source code is a popular functionality for each IDE used, developers use it widely to find places where a specific keyword exist. Some IDE provides advanced search possibilities like using regular expressions. But what about searching a specific behavior in your source code.

By behavior I mean a treatment where some methods are called, some fields are assigned, and others are read in a method. Let’s take as example this code snippet from a financial library: Continue reading “Search a specific treatments in your C/C++ source code”

Please vote if you want to convince Microsoft to provide a modern API for WinRT.

In September, 2011, a user with the pseudo name jalf did a good suggestion to Microsoft through their user voice platform, here’s a part of his suggestion:

Now that WinRT has been unveiled, a lot of people have criticized the C++/CLI-like quasi-C++ that is the recommended way to interface with the API. And honestly, it looks reasonably nice. If we’re willing to give up all hopes of using another compiler than VC11, and don’t mind non-standard code in our C++ application, it seem a nice way to interface with WinRT.

Continue reading “Please vote if you want to convince Microsoft to provide a modern API for WinRT.”

C++ is not a legacy language anymore

C++ has been stagnated for many years, and many developers were confident that the language would have the same destiny as Cobol, Fortran, and VB6. Furthermore, No new projects would be developed with it and C++ developers would do just the maintenance of existing projects, which makes it a legacy language. On the contrary and against all odds, C++ is reborned from its ashes and the new standards are importantly changing how the language is used. Continue reading “C++ is not a legacy language anymore”

Modernize your C++ code

C++11 includes several additions to the core language and extends the C++ standard library. Some of these new features are very easy to use and bring a big added value to your C++ projects.

It’s interesting to detect automatically places where we can use some C++11 new features. For such needs clang-modernize is a standalone tool used to automatically convert C++ code, written against old standards, to use features of the newest C++ standard where appropriate.  Continue reading “Modernize your C++ code”

Make the most of CppCheck

Static code analysis is the process of detecting flaws in software’s source code.  The static analysis tools are useful to detect common coding mistakes; here are some benefits from using them:

  • Make the code source more readable and maintainable.
  • Prevent unexpected behavior in execution.
  • Optimize the execution.
  • Make the code more secure.

Continue reading “Make the most of CppCheck”

Some standards are made to be ignored

Let’s begin with the definition of standardization from wikipedia :

Standardization is the process of developing and implementing technical standards. Standardization can help to maximize compatibilityinteroperability,safetyrepeatability, or quality.

On software development, the use of standards has huge benefits in protecting your projects from changing frameworks and tools. Some standards are widely used and adopted, others are used with moderation, a few or sometimes just a subset of them are simply ignored. Continue reading “Some standards are made to be ignored”

PArchitect Beta For Windows is now available.

We are pleased to announce the availability of PArchitect beta version for windows. PArchitect is a  Php tool which simplifies managing a given Php code base. It enables you to analyze code structure, specify design rules, do effective code reviews and master evolution by comparing different versions of the code. PArchitect could be downloaded from here.

Here are some interesting PArchitect features: Continue reading “PArchitect Beta For Windows is now available.”