Fixed the following SonarQube code smells:

1) Do not use the Array index in keys.
2) Import from the same module should be merged.
3) Mutable variables should not be exported.
4) Variables should not be initialized to undefined.
5) startswith or endswith method should be used.
6) Unwrap this unnecessarily grouped subpattern.

Additionally, addressed many other SonarQube rules.
This commit is contained in:
Akshay Joshi
2024-06-12 18:09:06 +05:30
parent 288fd7ed12
commit dea5335ce5
29 changed files with 51 additions and 57 deletions

View File

@@ -106,14 +106,14 @@ const DiskStatsTable = (props) => {
<Table classNameRoot='Storage-tableWhiteSpace'>
<thead>
<tr>
{tableHeader.map((item, index) => (
<th key={index}>{item.header}</th>
{tableHeader.map((item) => (
<th key={item.header}>{item.header}</th>
))}
</tr>
</thead>
<tbody>
{data.map((item, index) => (
<tr key={index}>
{data.map((item) => (
<tr key={item.file_system_type + item.mount_point}>
{tableHeader.map((header, id) => (
<td key={header.accessorKey+'-'+id}>{item[header.accessorKey]}</td>
))}

View File

@@ -54,8 +54,8 @@ const SummaryTable = (props) => {
</tr>
</thead>
<tbody>
{data.map((item, index) => (
<tr key={index}>
{data.map((item) => (
<tr key={item.name}>
<td>{item.name}</td>
<td>{item.value}</td>
</tr>