Skip to content

fix: resolve SonarQube code quality issues#1

Open
Fauxirius wants to merge 1 commit intomainfrom
gemini-sonarqube-fixes
Open

fix: resolve SonarQube code quality issues#1
Fauxirius wants to merge 1 commit intomainfrom
gemini-sonarqube-fixes

Conversation

@Fauxirius
Copy link
Owner

SonarQube Triage Summary

This PR addresses code quality issues identified by SonarQube.

Fixed Issues

1. S106: Replace this use of 'System.out' with a logger

  • Type: CODE_SMELL
  • Severity: MAJOR
  • File: JU4/src/main/java/com/javatechie/pm/api/service/OrderService.java

Before:

	private int addDiscount(OrderRequest order) {
		System.out.println("called...");
		int price = order.getPrice();

After:

package com.javatechie.pm.api.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// ...

@Service
public class OrderService {

    private static final Logger logger = LoggerFactory.getLogger(OrderService.class);
    // ...
	private int addDiscount(OrderRequest order) {
		logger.info("called...");
		int price = order.getPrice();

Verification Notes

  • Verified that System.out.println was replaced with a standard SLF4J logger.
  • Ensured appropriate imports (org.slf4j.Logger, org.slf4j.LoggerFactory) were added.
  • Added a static final logger instance to the OrderService class.

Resolved SonarQube issue S106 in src/main/java/com/javatechie/pm/api/service/OrderService.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant