<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tomislav Atanasoski on Medium]]></title>
        <description><![CDATA[Stories by Tomislav Atanasoski on Medium]]></description>
        <link>https://medium.com/@tomislavatanasoski?source=rss-f39ac60e2996------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*EicajLaG7hrxtIkWP3EFlA.jpeg</url>
            <title>Stories by Tomislav Atanasoski on Medium</title>
            <link>https://medium.com/@tomislavatanasoski?source=rss-f39ac60e2996------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 10:14:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomislavatanasoski/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pull request and commit message guidelines]]></title>
            <link>https://medium.com/@tomislavatanasoski/pull-request-and-commit-message-guidelines-10c4ed17cb4a?source=rss-f39ac60e2996------2</link>
            <guid isPermaLink="false">https://medium.com/p/10c4ed17cb4a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[git-commit-messages]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[pull-request-reviews]]></category>
            <category><![CDATA[merge-request]]></category>
            <dc:creator><![CDATA[Tomislav Atanasoski]]></dc:creator>
            <pubDate>Thu, 23 Dec 2021 09:55:43 GMT</pubDate>
            <atom:updated>2021-12-23T09:55:43.483Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpdCB8ssHVk6dpHL31rKbA.jpeg" /></figure><p>Code review is a very critical aspect of the software development cycle and is often complicated and time-consuming.</p><p>Having a Pull Request and commit message guidelines helps code reviewers from one side to move tickets out of the “in review” column quickly, while from the other side helps the developer to split the Pull Requests and commits into logical units.</p><p>If the developer wants to open a Pull Request with higher quality, he should consider it as a product offered to the code reviewer which needs to be well packed and sold to him.</p><p>In order for the product to be well packed, we need to ensure that all bits and pieces are aligned under some guidelines.</p><h3>Pull Requests</h3><h4><strong>Smaller Pull Requests</strong></h4><ul><li><strong>follow the agile principles</strong> — while working on a big feature, divide the feature into smaller logical tickets which will lead to smaller Pull Requests</li><li><strong>don’t do too much extra work</strong> — it’s good to clean up the code as you go, but do it in smaller steps. If something bigger needs to be refactored, do it in a separate ticket/PR</li><li><strong>work on the units first, and integration later</strong> —if there is no other way of splitting the PR/tickets, plan ahead to decouple the functionalities which can be written ahead independently piece by piece in separated Pull Requests, and at the end, connect the dots</li></ul><h4>Meaningful Pull Request descriptions and titles</h4><ul><li>use a template for describing <strong>WHAT</strong>, <strong>WHY</strong> was changed and add step by step guide for <strong>testing</strong> those changes.</li><li>the smaller the PR, the smaller the amount of description inside the PR — this will encourage the developer to open smaller Pull Requests</li><li>if needed, add screenshots, images, or other kinds of media for easing the review process</li><li>if needed, add a checklist of things to fulfill before approving the Pull Request</li></ul><h3>Commits</h3><h4>Meaningful commit messages</h4><ul><li>having unified commit messages across projects, helps developers be familiar with the meaning and the content of the commit</li><li>having meaningful commit messages means splitting the PR into small logical chunks</li><li>it helps the reviewer in understanding the scope of the commit</li></ul><h4>Guidelines</h4><ol><li><strong>Always include the JIRA (or other PM software) ticket in the subject</strong> — this will enforce the developer to have a ticket for every commit</li><li><strong>Limit the subject line to 72 characters</strong></li><li><strong>If the subject has to describe something with more than 72 characters, add a body with a blank line</strong></li><li><strong>Capitalize the subject line and do not end the subject with a period</strong></li><li><strong>Use the imperative mood in the subject line.</strong> The commit subject should be able to properly complete the following sentence: <em>If applied, this commit will</em>…</li></ol><h4>Proposed templates</h4><ol><li>&lt;JIRA-no&gt; | &lt;type&gt;(&lt;optional scope&gt;): Description</li></ol><p><strong>Example</strong>: JIR-100 | feat(timeline): Add an event for new activity</p><p>2. &lt;type&gt;(&lt;optional scope&gt;): Description | &lt;JIRA-no&gt;</p><p><strong>Example</strong>: feat(timeline): Add an event for new activity | JIR-100</p><p>3. &lt;JIRA-no&gt; | &lt;gitmoji type&gt;(&lt;optional scope&gt;): Description</p><p><strong>Example: </strong>JIR-100 | :sparkles:(timeline): Add an event for new activity</p><p>4. &lt;gitmoji type&gt;(&lt;optional scope&gt;): Description | &lt;JIRA-no&gt;</p><p><strong>Example:</strong> :sparkles:(timeline): Add an event for new activity | JIR-100</p><h4>Legend</h4><ul><li>&lt;<strong>JIRA-no</strong>&gt; — ID of the JIRA ticket</li><li>&lt;<strong>type</strong>&gt; — fix|feat|chore|docs|style|refactor|perf|test<br> — <strong>fix</strong> — fix a bug<br> — <strong>feat</strong> — new feature<br> — <strong>chore</strong> — regular code maintenance<br> — <strong>docs</strong> — documentation related<br> — <strong>style</strong> — styling related changes<br> — <strong>refactor</strong> — changes on existing code without changing the external behaviour<br> — <strong>perf</strong> — changes for improving the performance of code execution<br> — <strong>test</strong> — test related changes</li><li>&lt;<strong>optional scope</strong>&gt; — the domain or the scope where these changes are applied</li><li>&lt;<strong>gitmoji type</strong>&gt; — <a href="https://gitmoji.carloscuesta.me/">https://gitmoji.carloscuesta.me/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10c4ed17cb4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IMPROVE YOUR APPLICATION WITH STATIC CODE ANALYSIS]]></title>
            <link>https://medium.com/tuimm/improve-your-application-with-static-code-analysis-2fa86d8016c3?source=rss-f39ac60e2996------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fa86d8016c3</guid>
            <category><![CDATA[static-code-analysis]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Tomislav Atanasoski]]></dc:creator>
            <pubDate>Mon, 18 May 2020 08:35:43 GMT</pubDate>
            <atom:updated>2020-05-20T23:59:16.252Z</atom:updated>
            <content:encoded><![CDATA[<h3>Improve your application with static code analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*foDw-XZM5l3CHWgownyUQw.jpeg" /></figure><h3>What is a static code analyzer and why use it?</h3><p>In terms of software testing, a <a href="https://testing.googleblog.com/2007/03/difference-between-qa-qc-and-test.html">quality assurance team</a> has many roles to play. One of them is to provide continuous and consistent improvement and maintenance of the process that enables the quality control job. We most likely ignore it, but as developers, we fulfill a part of the mission when we introduce into our project <a href="https://en.wikipedia.org/wiki/Static_program_analysis">static code analyzers</a>. <a href="https://en.wikipedia.org/wiki/Fagan_inspection">Inspection</a> is indeed a part of the static testing which through a static code analyzer helps us to validate/review/detect early in the development phase when something is not respecting our quality criteria.</p><p>Since as we already know, <a href="https://en.wikipedia.org/wiki/PHP">PHP</a> is a loosely typed interpreted language, we cannot find possible execution errors without doing explicit inspections of the code.</p><pre>declare(strict_types=1);</pre><p>to the rescue.</p><p>Strict types will discover few bugs due to type mismatch, however, this feature is not as powerful as using static analyzers, as they are more flexible and provide more thorough code checks.</p><p>At the time we wrote this article, we picked three of the most popular PHP static code analyzers. The stars on <a href="https://github.com/">Github</a>, the number of contributors, and the frequency of repository updates were our criteria for popularity. Since we wanted to see what we got out of the box, we were testing the libraries without changing their default settings.</p><p>The test was carried out against a small PHP class that is a bad example of coding and was derived from a refactoring exercise repository: <a href="https://github.com/emilybache/Tennis-Refactoring-Kata">Tennis Refactoring Kata</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f74418327abd91c077473b33ff8582c7/href">https://medium.com/media/f74418327abd91c077473b33ff8582c7/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d7f29af78d05265694a2fc0cefa7512a/href">https://medium.com/media/d7f29af78d05265694a2fc0cefa7512a/href</a></iframe><p>As a result, we will show you the difference (git diff) after running the commands for every library.</p><h4>PHPStan (<a href="https://github.com/phpstan/phpstan">https://github.com/phpstan/phpstan</a>)</h4><p><strong>What does it do?</strong></p><p>PhpStan checks for:<br>– existence of classes used in instanceof, catch, type hints and other language constructs,<br>– existence and accessibility of called methods and functions<br>– number of passed arguments in methods, functions, and parameters<br>– respecting return types in methods and types when assigning parameters<br>– existence of variables respecting the scope<br>– strict comparison operators</p><p>The good thing is that you can carry out checks for a particular directory and for a different level of strictness. This could be very helpful if you are working on a large codebase as it would allow you to gradually fix the errors. There are 8 levels of strictness, 0 being the loosest and 7 being the most stringent.</p><p><strong>Installing:</strong></p><pre>composer require --dev phpstan/phpstan</pre><p><strong>Test:</strong></p><p>After initially running the analyzer with the default value of 0, we found a fatal PHP error from which we noticed that the analyzer not only checks the types of return methods and the existence of the classes/interfaces used but also checks if the class follows the method definitions of the interfaces implemented. And to our surprise, we couldn’t imagine what’s going to do until level 7.</p><pre>vendor/bin/phpstan analyse  src<br><br>PHP Fatal error:  Declaration of TennisGame1::wonPoint($playerName, $unused): void must be compatible with TennisGame::wonPoint($playerName) in /home/tomi/Projects/static_code_analysis/src/TennisGame1.php on line 5</pre><p>After fixing these errors, we were happy to see that it found out that the class is implementing a non-existent interface:</p><pre>vendor/bin/phpstan analyse -l 0 src                              <br><br> 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%<br><br> ------ ------------------------------------------------------------<br>  Line   src/TennisGame1.php                                                <br> ------ ------------------------------------------------------------<br>         Class NoneExistentInterface not found and could not be autoloaded.  <br> ------ ------------------------------------------------------------<br><br>                                                                                                                       <br> [ERROR] Found 1 error</pre><p>The next few errors caught were the non — existent exception, one that was not that crucial but still important, missing parameter type in the doc block, and the last error we had was level 3, which was the return type missing. Finally, we were good after level 3:</p><pre>vendor/bin/phpstan analyse -l 7 src<br> 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%<br><br>                                                                                                                       <br> [OK] No errors</pre><p>Besides being satisfied with the result, not catching the non — existent interface and non — strict comparison operator was a bit disappointing.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d8a2a2f1219200afd6f500adc4b9437/href">https://medium.com/media/9d8a2a2f1219200afd6f500adc4b9437/href</a></iframe><h4>PHP CodeSniffer (<a href="https://github.com/squizlabs/PHP_CodeSniffer">https://github.com/squizlabs/PHP_CodeSniffer</a>)</h4><p><strong>What does it do?</strong></p><p>PHP Codesniffer checks for violations of the defined coding standards and has a possibility to fix them.</p><p><strong>Installing:</strong></p><pre>composer require --dev squizlabs/php_codesniffer:3.*</pre><p><strong>Test:</strong></p><p>Since the analyzer’s default coding standard is <a href="https://pear.php.net/">PEAR</a>, we have had many errors that focused mainly on the files, classes, methods, and parameters commenting style.<br>Little disappointment was that only indentation and spacing errors could be fixed by the automatic fixer.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5109e3db0cb64dc9768c08762ecaee7a/href">https://medium.com/media/5109e3db0cb64dc9768c08762ecaee7a/href</a></iframe><p>After all the errors and fixing them manually, as the difference was big, we’ll show you only the difference in the interface:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7da0faac07bfbb8a91a56997854b2d54/href">https://medium.com/media/7da0faac07bfbb8a91a56997854b2d54/href</a></iframe><h4>PHP CSFixer (<a href="https://github.com/FriendsOfPHP/PHP-CS-Fixer">https://github.com/FriendsOfPHP/PHP-CS-Fixer</a>)</h4><p><strong>What does it do?</strong></p><p>The PHP Coding Standards Fixer (PHP CS Fixer) tool fixes the code to the standards set. By configuring, the coding standards against which the checks are conducted can be easily defined. <a href="https://www.php-fig.org/psr/psr-1/">PSR-1</a> and <a href="https://www.php-fig.org/psr/psr-2/">PSR-2</a> are the default configured coding standards.</p><p><strong>Installing</strong></p><pre>composer require --dev friendsofphp/php-cs-fixer</pre><p><strong>Test:</strong></p><pre>vendor/bin/php-cs-fixer fix src<br>Loaded config default.<br>Using cache file &quot;.php_cs.cache&quot;.<br>   1) src/TennisGame1.php<br><br>Fixed all files in 0.006 seconds, 10.000 MB memory used</pre><p>The command execution was simple and all errors detected were fixed. The response from the command was also minimal, and after running the command we didn’t have to take any further action. As the default standards checked are PSR1 and PSR2, the indentation, spacing, and opening braces have been fixed, as you can see from the result.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/799259789a4ccffe01a85a51618fa4a9/href">https://medium.com/media/799259789a4ccffe01a85a51618fa4a9/href</a></iframe><h4>Conclusion:</h4><p>Having coding style conventions is a smart thought since it helps developers not get occupied by code written in a different way when dealing with code they didn’t compose.</p><p>Code smell, on the other hand, is a symptom that may indicate a deeper problem within the code. Such examples are duplication of code, long names of methods, large methods, names that are not descriptive, etc.<br>Static code analyzers are developed primarily to detect deviations in conventions of coding style, not code smell. Since code smell is the more problematic topic, and the sustainability of the codebase could be significantly hurt, we as developers are bound by principles to write our code with the highest quality in order to avoid that.</p><p>PhpStan was the library that, we believe, came closer to detecting code smells than conventions of style. PHP CS Fixer, on the other hand, had a solid detection and fixer of standard coding deviations as well as minimal developer actions. Using these two libraries that do a good job in their scope can significantly improve the codebase quality.</p><p>In <a href="https://www.musement.com/us/about-us-2-p/">Musement</a> as we hope in many companies the quality of the software is fundamental to achieve high performance and to satisfy the customers (by the way we recommend <a href="https://www.amazon.com/Accelerate-Software-Performing-Technology-Organizations/dp/1942788339">this</a> book if you want to learn more). Luckily we have a huge PHP community (<a href="https://medium.com/@ondrejmirtes">Ondřej Mirtes</a>, <a href="http://fabien.potencier.org/">Fabien Potencier</a>, <a href="https://github.com/manuelpichler">Manuel Pichler</a>) which tremendously helped in the past years by providing valid tools to help to follow common coding standards and to early detect errors. So our advice is simple: “don’t be shy and use it! They are for most of them free and the quality of your project/team will increase!”</p><p><a href="https://www.linkedin.com/in/tatanasoski/">Tomislav Atanasoski</a> and <a href="https://it.linkedin.com/in/aur%C3%A9lien-lair-844385104">Aurélien Lair</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fa86d8016c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tuimm/improve-your-application-with-static-code-analysis-2fa86d8016c3">IMPROVE YOUR APPLICATION WITH STATIC CODE ANALYSIS</a> was originally published in <a href="https://medium.com/tuimm">TUI MM Engineering Center</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>