Fixed the following SonarQube code smells:

1) Do not use Array index in keys.
2) Unnecessary escape character.
3) Rename this local variable to match the regular expression ^[_a-z][a-z0-9_]*$
4) Remove the unused local variable.
This commit is contained in:
Akshay Joshi
2023-06-12 18:44:31 +05:30
parent 3e713cf58b
commit 251bf05692
31 changed files with 136 additions and 117 deletions

View File

@@ -175,11 +175,12 @@ export default function ProcessDetails({data}) {
{logs == null && <span data-test="loading-logs">{gettext('Loading process logs...')}</span>}
{logs?.length == 0 && gettext('No logs available.')}
{logs?.map((log, i)=>{
let id = logs.length-i;
return <div ref={(el)=>{
if(i==logs.length-1) {
el?.scrollIntoView();
}
}} key={i} className={errRe.test(log) ? classes.logErr : ''}>{log}</div>;
}} key={id} className={errRe.test(log) ? classes.logErr : ''}>{log}</div>;
})}
</Box>
<Box display="flex" alignItems="center">