Skip to content

Commit

Permalink
fix sonar issues (#65)
Browse files Browse the repository at this point in the history
* fix sonar issues

* bring back test
  • Loading branch information
eballo authored Jun 21, 2024
1 parent c514e53 commit dfd6c0b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/app/catalunya-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ class CatMap {

let llistaComarques = [];
for (let comarca in this.mappaths) {
let total = null;
if(this.mappaths[comarca].total) { total = this.mappaths[comarca].total }
llistaComarques.push({
name: this.mappaths[comarca].name,
url: this.mappaths[comarca].url,
total: this.mappaths[comarca].total
total: total
});
}

Expand All @@ -61,8 +63,16 @@ class CatMap {
});

// Create list with bootstrap styles
for (let i = 0; i < llistaComarques.length; i++) {
$("<li class='list-group-item'><a href='" + llistaComarques[i].url + "' class='list-group-item'>" + llistaComarques[i].name + "<span class='badge'>" + llistaComarques[i].total + "</span></a></li>").appendTo("ul.list");
for (let comarca of llistaComarques) {
let total_span = ""

if(comarca.total) {
total_span = "<span class='badge'>" + comarca.total + "</span>"
}

$("<li class='list-group-item'>" +
"<a href='" + comarca.url + "' class='list-group-item'>" + comarca.name +"" + total_span
+"</a></li>").appendTo("ul.list");
}
} else {
if (this.debug) {
Expand Down

0 comments on commit dfd6c0b

Please sign in to comment.