saasbook/baytrailbirding

View on GitHub

Showing 9 of 9 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class Hotspot {
/**
* Formatted hotspot data
* @param {Object} hotspot - Raw hotspot data
*/
Severity: Major
Found in app/assets/javascripts/index.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/index.js on lines 123..142

Similar blocks of code found in 2 locations. Consider refactoring.
Open

class Bird {
/**
* Formatted bird data
* @param {Object} bird - Raw bird data
*/
Severity: Major
Found in app/assets/javascripts/index.js and 1 other location - About 5 hrs to fix
app/assets/javascripts/index.js on lines 80..99

File index.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// ESLINT:
/* global L, moment, $ */
 
 
const MAX_RADIUS = 50; // Radius distance in KM
Severity: Minor
Found in app/assets/javascripts/index.js - About 3 hrs to fix

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    const watchId = navigator.geolocation.watchPosition(
    position => {
    const {
    coords
    } = position;
    Severity: Major
    Found in app/assets/javascripts/index.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/index.js on lines 556..569

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

    navigator.geolocation.getCurrentPosition(
    position => {
    const {
    coords
    } = position;
    Severity: Major
    Found in app/assets/javascripts/index.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/index.js on lines 588..601

    Function createBird has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    createBird(bird) {
    const { latLng } = bird.loc;
     
    const icon = L.divIcon({
    html: '<i class="fa-solid fa-dove fa-2x"></i>',
    Severity: Minor
    Found in app/assets/javascripts/index.js - About 1 hr to fix

      Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      constructor(elementId, currentPosition) {
      const tileLayerSource = 'https://a.tiles.mapbox.com/styles/v1/lohneswright/ciocejooj006obdnjhmd2x9qp/tiles/{z}/{x}/{y}?access_token={accessToken}';
       
      const map = L.map(elementId).setView([37.42, -121.91], 13);
       
      Severity: Minor
      Found in app/assets/javascripts/index.js - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        const markers = birds
        .filter(bird => bounds.contains(bird.loc.latLng))
        .map(bird => this.createBird(bird))
        Severity: Minor
        Found in app/assets/javascripts/index.js and 1 other location - About 40 mins to fix
        app/assets/javascripts/index.js on lines 302..304

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        const markers = hotspots
        .filter(hotspot => bounds.contains(hotspot.loc.latLng))
        .map(hotspot => this.createHotspot(hotspot));
        Severity: Minor
        Found in app/assets/javascripts/index.js and 1 other location - About 40 mins to fix
        app/assets/javascripts/index.js on lines 284..286
        Severity
        Category
        Status
        Source
        Language