iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

Refactor `backup/IoTDBDataBackTool.java` to resolve SonarQube issues

Open anukalp2804 opened this issue 6 months ago • 2 comments

Description

This task focuses on resolving multiple SonarCloud issues identified in backup/IoTDBDataBackTool.java.The file currently contains several maintainability and code quality violations, including:

  • Update this logger to use "IoTDBDataBackTool.class".
  • Rename this field "IS_OBJECT_STORAGE" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.
  • Use "isEmpty()" to check whether a "String" is empty or not.

File

iotdb-client/.../org/apache/iotdb/tool/backup/IoTDBDataBackTool.java

How to fix

1. 
LoggerFactory.getLogger(AbstractDataTool.class);
to
LoggerFactory.getLogger(IoTDBDataBackTool.class);

2.

static boolean IS_OBJECT_STORAGE = false;
to
static boolean isObjectStorage = false;

3. 
targetWalDirParam.length() > 0;
to
targetWalDirParam.isEmpty();

Sonar Issue

https://sonarcloud.io/project/issues?open=AY8JzfmBywzNF5Ghx44F&id=apache_iotdb

Note: The goal is to improve readability, maintainability, and compliance with SonarCloud quality standards without changing existing functionality.

anukalp2804 avatar May 21 '26 18:05 anukalp2804

Hi @HTHou , I would like to work on this issue. Could you please assign this to me?. Thank you.

anukalp2804 avatar May 21 '26 18:05 anukalp2804

Hi @HTHou , I have create this issue last week. So can you please reveiw it and assign it to me. So i can start the work and raise pr for this one issue. Thank you

anukalp2804 avatar May 27 '26 17:05 anukalp2804