Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!