<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Code-Quality on Daffa Abhipraya</title><link>https://blog.abhipraya.dev/tags/code-quality/</link><description>Recent content in Code-Quality on Daffa Abhipraya</description><generator>Hugo</generator><language>en-us</language><copyright>© Daffa Abhipraya</copyright><lastBuildDate>Wed, 15 Apr 2026 00:00:00 +0700</lastBuildDate><atom:link href="https://blog.abhipraya.dev/tags/code-quality/index.xml" rel="self" type="application/rss+xml"/><item><title>PPL: Quality as a Feedback Loop [Sprint 2, Week 3]</title><link>https://blog.abhipraya.dev/ppl/part-b/s2w3-code-quality/</link><pubDate>Wed, 15 Apr 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s2w3-code-quality/</guid><description>&lt;h2 id="what-i-worked-on">
 &lt;a class="anchor" href="#what-i-worked-on" data-anchor="what-i-worked-on" aria-hidden="true">#&lt;/a>
 What I Worked On
&lt;/h2>
&lt;p>Two weeks of quality infrastructure: wiring in the tools that measure test quality (week 1), then shortening the feedback loop so that signal actually influences the code being written (week 2). Starting state: 91% line coverage, no mutation testing, integration test coverage missing from SonarQube. Ending state: combined unit + integration coverage in SonarQube, mutmut + Stryker running per-MR with results in the CI comment, API mutation score 80.3%.&lt;/p></description></item><item><title>PPL: Code Quality [Sprint 2, Week 2]</title><link>https://blog.abhipraya.dev/ppl/part-b/s2w2-code-quality/</link><pubDate>Mon, 30 Mar 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s2w2-code-quality/</guid><description>&lt;h2 id="what-i-worked-on">
 &lt;a class="anchor" href="#what-i-worked-on" data-anchor="what-i-worked-on" aria-hidden="true">#&lt;/a>
 What I Worked On
&lt;/h2>
&lt;p>This week I overhauled the CI quality feedback loop with four related MRs. Before this week, quality checks existed but results had to be hunted down manually in GitLab&amp;rsquo;s CI panel. After this week, every MR automatically receives quality reports as inline comments, and the SonarQube gate blocks merges that would lower the quality standard.&lt;/p>
&lt;hr>
&lt;h2 id="sonarqube-quality-gate-in-mr-comments">
 &lt;a class="anchor" href="#sonarqube-quality-gate-in-mr-comments" data-anchor="sonarqube-quality-gate-in-mr-comments" aria-hidden="true">#&lt;/a>
 SonarQube Quality Gate in MR Comments
&lt;/h2>
&lt;p>MR !132 (SIRA-231) added a &lt;code>sonar-scan&lt;/code> post-processing step that fetches the quality gate result from SonarQube and posts it directly as an MR comment via the GitLab API.&lt;/p></description></item><item><title>PPL: From 31 Violations to Zero [Sprint 2, Week 1]</title><link>https://blog.abhipraya.dev/ppl/part-b/s2w1-code-quality/</link><pubDate>Mon, 23 Mar 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s2w1-code-quality/</guid><description>&lt;h2 id="what-i-worked-on">
 &lt;a class="anchor" href="#what-i-worked-on" data-anchor="what-i-worked-on" aria-hidden="true">#&lt;/a>
 What I Worked On
&lt;/h2>
&lt;p>This week I enforced strict quality gates across the entire CI pipeline. The project previously had &lt;code>allow_failure: true&lt;/code> on SonarQube and security scans, meaning violations were reported but never blocked merges. I changed that.&lt;/p>
&lt;h2 id="sonarqube-31-violations--0">
 &lt;a class="anchor" href="#sonarqube-31-violations--0" data-anchor="sonarqube-31-violations--0" aria-hidden="true">#&lt;/a>
 SonarQube: 31 Violations → 0
&lt;/h2>
&lt;h3 id="the-violations">
 &lt;a class="anchor" href="#the-violations" data-anchor="the-violations" aria-hidden="true">#&lt;/a>
 The Violations
&lt;/h3>
&lt;p>SonarQube flagged 31 issues across the codebase:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>1 CRITICAL vulnerability&lt;/strong>: &lt;code>jwt.get_unverified_header()&lt;/code> reading JWT headers without signature verification&lt;/li>
&lt;li>&lt;strong>3 CRITICAL code smells&lt;/strong>: duplicated string literals, nested component definitions&lt;/li>
&lt;li>&lt;strong>27 other issues&lt;/strong>: unused variables, missing &lt;code>Readonly&amp;lt;&amp;gt;&lt;/code> on props, duplicate CSS blocks, array index keys&lt;/li>
&lt;/ul>
&lt;h3 id="the-fixes">
 &lt;a class="anchor" href="#the-fixes" data-anchor="the-fixes" aria-hidden="true">#&lt;/a>
 The Fixes
&lt;/h3>
&lt;p>&lt;strong>Backend&lt;/strong> (3 files): Refactored JWT decode to try HS256 first and fall back to asymmetric on &lt;code>DecodeError&lt;/code>, eliminating the unverified header call entirely. Extracted duplicated literals to constants.&lt;/p></description></item><item><title>PPL: Code Quality [Sprint 1, Week 3]</title><link>https://blog.abhipraya.dev/ppl/part-b/s1w3-code-quality/</link><pubDate>Fri, 13 Mar 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s1w3-code-quality/</guid><description>&lt;h2 id="what-i-worked-on">
 &lt;a class="anchor" href="#what-i-worked-on" data-anchor="what-i-worked-on" aria-hidden="true">#&lt;/a>
 What I Worked On
&lt;/h2>
&lt;p>This week I extended the CI quality pipeline with two significant additions: a &lt;strong>migration dry-run validation job&lt;/strong> that catches invalid SQL before merge (MR !67), and ongoing enforcement of zero SonarQube issues across the codebase. The pre-commit hook stack also proved its value by catching issues during the heavy development push of 14 MRs.&lt;/p>
&lt;h2 id="new-ci-job-migration-dry-run-validation">
 &lt;a class="anchor" href="#new-ci-job-migration-dry-run-validation" data-anchor="new-ci-job-migration-dry-run-validation" aria-hidden="true">#&lt;/a>
 New CI Job: Migration Dry-Run Validation
&lt;/h2>
&lt;p>The most impactful quality improvement this week was adding &lt;code>migrate:check&lt;/code> to the CI pipeline (MR !67, SIRA-98). This job runs &lt;code>supabase db push --dry-run&lt;/code> on every MR pipeline, validating that migration files are syntactically correct and compatible with the remote database before the MR can be merged.&lt;/p></description></item><item><title>PPL: Static Analysis in SIRA [Sprint 1, Week 2]</title><link>https://blog.abhipraya.dev/ppl/part-b/s1w2-code-quality/</link><pubDate>Wed, 04 Mar 2026 00:00:00 +0700</pubDate><guid>https://blog.abhipraya.dev/ppl/part-b/s1w2-code-quality/</guid><description>&lt;h2 id="the-tool-stack">
 &lt;a class="anchor" href="#the-tool-stack" data-anchor="the-tool-stack" aria-hidden="true">#&lt;/a>
 The Tool Stack
&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Layer&lt;/th>
 &lt;th>Tool&lt;/th>
 &lt;th>Scope&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>Frontend lint + format&lt;/td>
 &lt;td>&lt;a href="https://biomejs.dev">Biome&lt;/a>&lt;/td>
 &lt;td>TypeScript/TSX, 40+ enforced rules&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Frontend dead code&lt;/td>
 &lt;td>&lt;a href="https://knip.dev">Knip&lt;/a>&lt;/td>
 &lt;td>Unused exports, imports, dependencies&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Frontend types&lt;/td>
 &lt;td>&lt;code>tsc --noEmit&lt;/code>&lt;/td>
 &lt;td>TypeScript type checking&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Backend lint + format&lt;/td>
 &lt;td>&lt;a href="https://docs.astral.sh/ruff/">Ruff&lt;/a>&lt;/td>
 &lt;td>Python, F401/F841 + style rules&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Backend types&lt;/td>
 &lt;td>&lt;a href="https://mypy.readthedocs.io">mypy&lt;/a>&lt;/td>
 &lt;td>Python static types, strict mode&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>CI quality gate&lt;/td>
 &lt;td>&lt;a href="https://sonarqube.cs.ui.ac.id">SonarQube&lt;/a>&lt;/td>
 &lt;td>Coverage, code smells, security hotspots&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;h2 id="pre-commit-hooks-husky">
 &lt;a class="anchor" href="#pre-commit-hooks-husky" data-anchor="pre-commit-hooks-husky" aria-hidden="true">#&lt;/a>
 Pre-commit Hooks (Husky)
&lt;/h2>
&lt;p>Five checks run sequentially on every &lt;code>git commit&lt;/code>. A failure at any step blocks the commit:&lt;/p></description></item></channel></rss>