fga-gpp-mds/2017.1-OndeE-UnB

View on GitHub

Showing 364 of 364 total issues

Class has too many lines. [168/100]
Open

class ParserController < ApplicationController
  before_action :authenticate_admin!
  def index
    render plain: schedules
  end

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

$(pointsPages).ready(function() {
  // show floor plans

  var options = {
    marker: true
Severity: Major
Found in darcyWeb/app/assets/javascripts/admin/points.js and 1 other location - About 7 hrs to fix
darcyWeb/app/assets/javascripts/admin/buildings.js on lines 4..28

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 189.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

$(buildingsPages).ready(function() {

  // show floor plans

  var options = {
Severity: Major
Found in darcyWeb/app/assets/javascripts/admin/buildings.js and 1 other location - About 7 hrs to fix
darcyWeb/app/assets/javascripts/admin/points.js on lines 1..23

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 189.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method has too many lines. [69/25]
Open

    def index
        @contributors = [
            {
                avatar: "https://avatars0.githubusercontent.com/u/10123141?v=3&s=400",
                name: "Alexandre Kryonidis",

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for schedules is too high. [38.72/15]
Open

  def schedules
    require 'nokogiri'
    require 'open-uri'

    courses.each do |course|

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

$.getJSON("/map/data/bikes", function(bikes) { //getting the json data
  bikes.forEach(function(bike) {
    try {
      var geoJSON = JSON.parse(bike.geo_data);
      bikesLayer.addData(geoJSON); //adding the json data to the building layer
Severity: Major
Found in darcyWeb/app/assets/javascripts/map/data/bikes.js and 1 other location - About 3 hrs to fix
darcyWeb/app/assets/javascripts/map/data/bathroom.js on lines 17..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 96.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

$.getJSON("/map/data/bathrooms", function(bathrooms) { //getting the json data
  bathrooms.forEach(function(bathroom) {
    try {
      var geoJSON = JSON.parse(bathroom.geo_data);
      bathroomLayer.addData(geoJSON); //adding the json data to the building layer
Severity: Major
Found in darcyWeb/app/assets/javascripts/map/data/bathroom.js and 1 other location - About 3 hrs to fix
darcyWeb/app/assets/javascripts/map/data/bikes.js on lines 17..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 96.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method has too many lines. [36/25]
Open

  def schedules
    require 'nokogiri'
    require 'open-uri'

    courses.each do |course|

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

$.getJSON("/map/data/snackbars", function(snackbars) { //getting the json data
  snackbars.forEach(function(snackbar) {
    try {
      var geoJSON = JSON.parse(snackbar.geo_data);
      snackbarLayer.addData(geoJSON); //adding the json data to the building layer
Severity: Major
Found in darcyWeb/app/assets/javascripts/map/data/snackbar.js and 3 other locations - About 2 hrs to fix
darcyWeb/app/assets/javascripts/map/data/busstops.js on lines 16..25
darcyWeb/app/assets/javascripts/map/data/entrance.js on lines 16..25
darcyWeb/app/assets/javascripts/map/data/informationpoints.js on lines 14..23

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

$.getJSON("/map/data/entrances", function(entrances) { //getting the json data
  entrances.forEach(function(entrance) {
    try {
      var geoJSON = JSON.parse(entrance.geo_data);
      entranceLayer.addData(geoJSON); //adding the json data to the building layer
Severity: Major
Found in darcyWeb/app/assets/javascripts/map/data/entrance.js and 3 other locations - About 2 hrs to fix
darcyWeb/app/assets/javascripts/map/data/busstops.js on lines 16..25
darcyWeb/app/assets/javascripts/map/data/informationpoints.js on lines 14..23
darcyWeb/app/assets/javascripts/map/data/snackbar.js on lines 16..25

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

$.getJSON("/map/data/busstops", function(data) { //getting the json data
  data.forEach(function(busStop) {
    try {
      var geoJSON = JSON.parse(busStop.geo_data);
      busstopLayer.addData(geoJSON); //adding the json data to the building layer
Severity: Major
Found in darcyWeb/app/assets/javascripts/map/data/busstops.js and 3 other locations - About 2 hrs to fix
darcyWeb/app/assets/javascripts/map/data/entrance.js on lines 16..25
darcyWeb/app/assets/javascripts/map/data/informationpoints.js on lines 14..23
darcyWeb/app/assets/javascripts/map/data/snackbar.js on lines 16..25

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

$.getJSON("/map/data/informationpoints", function(informationpoints) { //getting the json data
  informationpoints.forEach(function(informationpoints) {
    try {
      var geoJSON = JSON.parse(informationpoints.geo_data);
      informationPointsLayer.addData(geoJSON); //adding the json data to the building layer
darcyWeb/app/assets/javascripts/map/data/busstops.js on lines 16..25
darcyWeb/app/assets/javascripts/map/data/entrance.js on lines 16..25
darcyWeb/app/assets/javascripts/map/data/snackbar.js on lines 16..25

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method index has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def index
        @contributors = [
            {
                avatar: "https://avatars0.githubusercontent.com/u/10123141?v=3&s=400",
                name: "Alexandre Kryonidis",
Severity: Major
Found in darcyWeb/app/controllers/about_controller.rb - About 2 hrs to fix

    Method has too many lines. [34/25]
    Open

      def geo(features)
        geo_json = []
        features.each do |feature|
    
          title = ''

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

    var snackbarLayer = L.geoJSON("", {
      pointToLayer: function(feature, latlng) {
        var smallIcon = new L.Icon({
          // TODO Remove direct link to image
          iconUrl: "http://icons.iconarchive.com/icons/graphicloads/colorful-long-shadow/24/Restaurant-icon.png",
    Severity: Major
    Found in darcyWeb/app/assets/javascripts/map/data/snackbar.js and 2 other locations - About 2 hrs to fix
    darcyWeb/app/assets/javascripts/map/data/busstops.js on lines 3..14
    darcyWeb/app/assets/javascripts/map/data/entrance.js on lines 3..14

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 88.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    var busstopLayer = L.geoJSON("", {
      pointToLayer: function(feature, latlng) {
        var smallIcon = new L.Icon({
          // TODO Remove direct link to image
          iconUrl: "http://icons.iconarchive.com/icons/elegantthemes/beautiful-flat/32/school-bus-icon.png",
    Severity: Major
    Found in darcyWeb/app/assets/javascripts/map/data/busstops.js and 2 other locations - About 2 hrs to fix
    darcyWeb/app/assets/javascripts/map/data/entrance.js on lines 3..14
    darcyWeb/app/assets/javascripts/map/data/snackbar.js on lines 3..14

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 88.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    var entranceLayer = L.geoJSON("", {
      pointToLayer: function(feature, latlng) {
        var smallIcon = new L.Icon({
          // TODO Remove direct link to image
          iconUrl: "http://icons.iconarchive.com/icons/elegantthemes/beautiful-flat-one-color/24/door-icon.png",
    Severity: Major
    Found in darcyWeb/app/assets/javascripts/map/data/entrance.js and 2 other locations - About 2 hrs to fix
    darcyWeb/app/assets/javascripts/map/data/busstops.js on lines 3..14
    darcyWeb/app/assets/javascripts/map/data/snackbar.js on lines 3..14

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 88.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function loadRooms has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var loadRooms = function loadRooms(buildingKey) {
      $.get("/map/data/rooms/" + buildingKey, function(data) { //getting the json data
    
        var rooms = {
          "type": "FeatureCollection",
    Severity: Major
    Found in darcyWeb/app/assets/javascripts/map/data/rooms.js - About 2 hrs to fix

      Assignment Branch Condition size for geo is too high. [20.62/15]
      Open

        def geo(features)
          geo_json = []
          features.each do |feature|
      
            title = ''

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

      Block has too many lines. [48/25]
      Open

      Rails.application.routes.draw do
        mount JasmineRails::Engine => '/specs' if defined?(JasmineRails)
      
        devise_scope :admin do
          get 'admin/login', to: 'devise/sessions#new', as: 'new_login'
      Severity: Minor
      Found in darcyWeb/config/routes.rb by rubocop

      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

      Severity
      Category
      Status
      Source
      Language