northworld/google_calendar

View on GitHub

Showing 6 of 6 total issues

Class Event has 47 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Event
    attr_reader :id, :raw, :html_link, :status, :transparency, :visibility
    attr_writer :reminders, :recurrence, :extended_properties
    attr_accessor :title, :location, :calendar, :quickadd, :attendees, :description, :creator_name, :color_id, :guests_can_invite_others, :guests_can_see_other_guests, :send_notifications, :new_event_with_id_specified

Severity: Minor
Found in lib/google/event.rb - About 6 hrs to fix

    Class Calendar has 32 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Calendar
    
        attr_reader :id, :connection, :summary, :location, :description, :time_zone
    
        #
    Severity: Minor
    Found in lib/google/calendar.rb - About 4 hrs to fix

      File event.rb has 256 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'time'
      require 'json'
      require 'timezone_parser'
      
      module Google
      Severity: Minor
      Found in lib/google/event.rb - About 2 hrs to fix

        Method parse_extended_properties has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def parse_extended_properties(extended_properties) # :nodoc
              query_parts = []
              ['shared', 'private'].each do |prop_type|
                next unless extended_properties[prop_type]
                query_parts << extended_properties[prop_type].map {|key, value| (prop_type == "shared" ? "sharedExtendedProperty=" : "privateExtendedProperty=") + "#{key}%3D#{value}" }.join("&")
        Severity: Minor
        Found in lib/google/calendar.rb - About 45 mins 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 save_event has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def save_event(event)
              method = event.new_event? ? :post : :put
              body = event.use_quickadd? ? nil : event.to_json
              notifications = "sendNotifications=#{event.send_notifications?}"
              query_string =  if event.use_quickadd?
        Severity: Minor
        Found in lib/google/calendar.rb - About 35 mins 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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def initialize(params, client=nil)
        
              raise ArgumentError unless client || Connection.credentials_provided?(params)
        
              @client = client || Signet::OAuth2::Client.new(
        Severity: Minor
        Found in lib/google/connection.rb - About 25 mins 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