joegattnet/joegattnet_v3

View on GitHub

Showing 65 of 103 total issues

Function Gmaps4Rails has 400 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.Gmaps4Rails = (function() {

    function Gmaps4Rails() {
      this.map = null;
      this.serviceObject = null;
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 2 days to fix

Function Gmaps4RailsGoogle has 387 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.Gmaps4RailsGoogle = (function(_super) {

    __extends(Gmaps4RailsGoogle, _super);

    function Gmaps4RailsGoogle() {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js - About 1 day to fix

Function Gmaps4RailsOpenlayers has 228 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.Gmaps4RailsOpenlayers = (function(_super) {

    __extends(Gmaps4RailsOpenlayers, _super);

    function Gmaps4RailsOpenlayers() {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.openlayers.js - About 1 day to fix

Class Note has 55 methods (exceeds 20 allowed). Consider refactoring.
Open

class Note < ActiveRecord::Base
  include NoteCustom, Syncable

  attr_writer :tag_list, :instruction_list, :keyword_list
  attr_accessor :external_created_at
Severity: Major
Found in app/models/note.rb - About 7 hrs to fix

Function Gmaps4RailsBing has 186 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.Gmaps4RailsBing = (function(_super) {

    __extends(Gmaps4RailsBing, _super);

    function Gmaps4RailsBing() {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.bing.js - About 7 hrs to fix

File gmaps4rails.base.js has 425 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
  var Gmaps;

  Gmaps = {};

Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 6 hrs to fix

Function Gmaps4RailsMapquest has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.Gmaps4RailsMapquest = (function(_super) {

    __extends(Gmaps4RailsMapquest, _super);

    function Gmaps4RailsMapquest() {
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.mapquest.js - About 5 hrs to fix

File gmaps4rails.googlemaps.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function() {
  var __hasProp = Object.prototype.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };

  this.Gmaps4RailsGoogle = (function(_super) {
Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js - About 5 hrs to fix

Class Pantograph has 33 methods (exceeds 20 allowed). Consider refactoring.
Open

class Pantograph < ActiveRecord::Base

  include Pantographable

  belongs_to :pantographer
Severity: Minor
Found in app/models/pantograph.rb - About 4 hrs to fix

File formatting_helper.rb has 320 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module FormattingHelper
  def bodify(text, books = [], books_citation_style = 'citation.book.inline_annotated_html', links_citation_style = 'citation.link.inline_annotated_html', annotated = true)
    return '' if text.blank?
    # REVIEW: Add settings condition
    text = related_notify(text)
Severity: Minor
Found in app/helpers/formatting_helper.rb - About 3 hrs to fix

File note.rb has 294 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Note < ActiveRecord::Base
  include NoteCustom, Syncable

  attr_writer :tag_list, :instruction_list, :keyword_list
  attr_accessor :external_created_at
Severity: Minor
Found in app/models/note.rb - About 3 hrs to fix

Method update_resources_with_evernote_data has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def update_resources_with_evernote_data(cloud_note_data)
    # First we remove all resources (to make sure deleted resources disappear -
    #  but we don't want to delete binaries so we use #delete rather than #destroy)
    evernote_note.note.resources.delete_all

Severity: Minor
Found in app/models/evernote_request.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Gmaps4Rails has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Gmaps4Rails() {
      this.map = null;
      this.serviceObject = null;
      this.visibleInfoWindow = null;
      this.userLocation = null;
Severity: Major
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 2 hrs to fix

Method sync_down has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  def sync_down(evernote_note)
    evernote_note.build_note if evernote_note.note.nil?

    self.evernote_note = evernote_note
    self.guid = evernote_note.cloud_note_identifier
Severity: Minor
Found in app/models/evernote_request.rb - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Gmaps4RailsGoogle has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function Gmaps4RailsGoogle() {
      Gmaps4RailsGoogle.__super__.constructor.apply(this, arguments);
      this.map_options = {
        disableDefaultUI: false,
        disableDoubleClickZoom: false,
Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js - About 1 hr to fix

Method calculate_after has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  def self.calculate_after(current)
    return last_text if current == last_text
    alphabet = self.alphabet.split('')
    alphabet_without_space = alphabet - [' ']

Severity: Minor
Found in app/models/pantograph.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Consider simplifying this complex logical expression.
Open

      if ((circle.lat != null) && (circle.lng != null)) {
        newCircle = new google.maps.Circle({
          center: this.createLatLng(circle.lat, circle.lng),
          strokeColor: circle.strokeColor || this.circles_conf.strokeColor,
          strokeOpacity: circle.strokeOpacity || this.circles_conf.strokeOpacity,
Severity: Critical
Found in public/javascripts/gmaps4rails/gmaps4rails.base.js - About 1 hr to fix

Function createClusterer has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Gmaps4RailsOpenlayers.prototype.createClusterer = function(markers_array) {
      var clusters, funcs, options, strategy, style;
      options = {
        pointRadius: "${radius}",
        fillColor: "#ffcc66",
Severity: Minor
Found in public/javascripts/gmaps4rails/gmaps4rails.openlayers.js - About 1 hr to fix

Method from_omniauth has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def self.from_omniauth(auth, current_user)
    authorization = Authorization.where(provider: auth.provider, uid: auth.uid.to_s).first_or_initialize
    authorization.token = auth.credentials.token
    authorization.secret = auth.credentials.secret

Severity: Minor
Found in app/models/user.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method cut_image_binary has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def cut_image_binary(id, _format, aspect_x, aspect_y, width, snap, gravity, effects)
    image_record = Resource.find(id)

    file_name_template = image_record.template_location(aspect_x, aspect_y)
    file_name_out = image_record.cut_location(aspect_x, aspect_y, width, snap, gravity, effects)
Severity: Minor
Found in app/helpers/resources_helper.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language