Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
Sonar issue - Remove this assignment of "k"

I am getting this issue in sonar. I don't know why it's giving this issue.

enter image description here

The code is:

for(let k=0; k<this.side_list.length; ++k){
  if(this.allowedPageList.indexOf(this.side_list[k].route) === -1){
    this.side_list.splice(k,1); --k;
  }else{
    if(this.side_list[k].children?.length > 0){
      for(let l=0; l<this.side_list[k].children.length; ++l){
        if(this.allowedPageList.indexOf(this.side_list[k].children[l].route) === -1){
          this.side_list[k].children.splice(l,1); --l;
        }
      }
    }
  }
}

Can somebody please help me fix this issue? Is sonar asking me to remove --k and --l from the code? But that can then disrupt the function.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda