Endle / fireSeqSearch

Found labeled statements JS-0071
Anti-pattern
Minor
9 months agoa year old
Unexpected label in break statement
1122                                    if (imageData[((gy * g + y) * ngx * g +
1123                                        (gx * g + x)) * 4 + i] !== bgPixel[i]) {
1124                                        grid[gx][gy] = false
1125                                        break singleGridLoop1126                                    }
1127                                }
1128                            }
Unexpected labeled statement
1114                    while (gy--) {
1115                        y = g
1116                        /* eslint no-labels: ["error", { "allowLoop": true }] */
1117                        singleGridLoop: while (y--) {1118                            x = g1119                            while (x--) {1120                                i = 41121                                while (i--) {1122                                    if (imageData[((gy * g + y) * ngx * g +1123                                        (gx * g + x)) * 4 + i] !== bgPixel[i]) {1124                                        grid[gx][gy] = false1125                                        break singleGridLoop1126                                    }1127                                }1128                            }1129                        }1130                        if (grid[gx][gy] !== false) {
1131                            grid[gx][gy] = true
1132                        }
Unexpected label in break statement
 683                                    fctx.fillStyle = 'rgba(255, 0, 0, 0.5)'
 684                                    fctx.fillRect(gx * g, gy * g, g - 0.5, g - 0.5)
 685                                }
 686                                break singleGridLoop 687                            }
 688                        }
 689                    }
Unexpected labeled statement
 659                while (gy--) {
 660                    y = g
 661                    /* eslint no-labels: ["error", { "allowLoop": true }] */
 662                    singleGridLoop: while (y--) { 663                        x = g 664                        while (x--) { 665                            if (imageData[((gy * g + y) * width + 666                                (gx * g + x)) * 4 + 3]) { 667                                occupied.push([gx, gy]) 668 669                                if (gx < bounds[3]) { 670                                    bounds[3] = gx 671                                } 672                                if (gx > bounds[1]) { 673                                    bounds[1] = gx 674                                } 675                                if (gy < bounds[0]) { 676                                    bounds[0] = gy 677                                } 678                                if (gy > bounds[2]) { 679                                    bounds[2] = gy 680                                } 681 682                                if (debug) { 683                                    fctx.fillStyle = 'rgba(255, 0, 0, 0.5)' 684                                    fctx.fillRect(gx * g, gy * g, g - 0.5, g - 0.5) 685                                } 686                                break singleGridLoop 687                            } 688                        } 689                    } 690                    if (debug) {
 691                        fctx.fillStyle = 'rgba(0, 0, 255, 0.5)'
 692                        fctx.fillRect(gx * g, gy * g, g - 0.5, g - 0.5)