3scale/porta

View on GitHub

Showing 5,205 of 5,561 total issues

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

class Metric < ApplicationRecord
include Backend::ModelExtensions::Metric
include SystemName
include BackendApiLogic::MetricExtension
include Searchable
Severity: Minor
Found in app/models/metric.rb - About 4 hrs to fix

    File notification_mailer.rb has 321 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class NotificationMailer < ActionMailer::Base
    default from: Rails.configuration.three_scale.notification_email
     
    layout 'notification_email'
     
     
    Severity: Minor
    Found in app/mailers/notification_mailer.rb - About 3 hrs to fix

      File plan.rb has 316 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class Plan < ApplicationRecord
      include Searchable
      class PeriodRangeCalculationError < StandardError; end
      include Symbolize
       
       
      Severity: Minor
      Found in app/models/plan.rb - About 3 hrs to fix

        Class Report has 28 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Report
        include Printer
         
        attr_accessor :account, :period, :pdf, :service, :report
         
         
        Severity: Minor
        Found in app/lib/pdf/report.rb - About 3 hrs to fix

          File billing_strategy.rb has 305 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class Finance::BillingStrategy < ApplicationRecord
          module NonAuditedColumns
          def non_audited_columns
          super - [inheritance_column]
          end
          Severity: Minor
          Found in app/models/finance/billing_strategy.rb - About 3 hrs to fix

            Method selector_for has 81 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def selector_for(scope) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
            case scope
             
            #
            # Page sections
            Severity: Major
            Found in features/support/selectors.rb - About 3 hrs to fix

              Method create_builtin_pages_and_partials! has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def create_builtin_pages_and_partials!
              p = provider.builtin_pages
               
              # Shared
              create_builtin_partial!('field')
              Severity: Major
              Found in app/lib/simple_layout.rb - About 3 hrs to fix

                Class MailPreview has 27 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class MailPreview < MailView
                FakeContract = Struct.new(:id, :old_plan, :plan, :provider_account, :service, :account, :name)
                 
                def application_created
                event = Applications::ApplicationCreatedEvent.create(Cinstance.last, User.last)
                Severity: Minor
                Found in app/mailers/mail_preview.rb - About 3 hrs to fix

                  Method search has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def search
                  puts 'Searching for invalid data'
                   
                   
                  Account.providers.find_each do |p|
                  Severity: Minor
                  Found in script/detect-invalid-data.rb - About 3 hrs to fix

                  Method to_xml has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def to_xml(options = {})
                  #TODO: use Nokogiri builder
                  xml = options[:builder] || ThreeScale::XML::Builder.new
                   
                  xml.account do |xml|
                  Severity: Minor
                  Found in app/models/account.rb - About 3 hrs to fix

                  Method provider_request has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def provider_request
                  return unless provider?
                   
                  hourly(&:group)
                   
                   
                  Severity: Major
                  Found in lib/tracking_notifications.rb - About 3 hrs to fix

                    Method assign_drops has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def assign_drops drops
                    assigns = (@_assigned_drops ||= {})
                     
                    drops.stringify_keys.each do |name, drop|
                    next if drop.nil?
                    Severity: Minor
                    Found in lib/developer_portal/lib/liquid/assigns.rb - About 2 hrs to fix

                    Method up has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    def self.up
                    create_table "forums", :force => true do |t|
                    t.integer "site_id"
                    t.string "name"
                    t.string "description"
                    Severity: Major
                    Found in db/migrate/20081112151449_tables_for_beast.rb - About 2 hrs to fix

                      Class Configuration has 25 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Configuration
                       
                      include Enumerable
                       
                      HARDWIRED_DEFAULTS = {
                      Severity: Minor
                      Found in app/models/configuration.rb - About 2 hrs to fix

                        Class UserTracking has 25 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class UserTracking
                         
                        error_handler = ->(status, error) do
                        System::ErrorReporting.report_error(UserTrackingError.new(status, error))
                        end
                        Severity: Minor
                        Found in app/lib/three_scale/analytics/user_tracking.rb - About 2 hrs to fix

                          Class Invoice has 25 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          class Invoice < Drops::Model
                           
                          allowed_name :invoice, :invoices
                           
                          example %{
                          Severity: Minor
                          Found in lib/developer_portal/lib/liquid/drops/invoice.rb - About 2 hrs to fix

                            Class User has 25 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class User < Drops::Model
                            allowed_name :user, :users
                             
                            drop_example %{
                            <h1>User {{ user.display_name }}</h1>
                            Severity: Minor
                            Found in lib/developer_portal/lib/liquid/drops/user.rb - About 2 hrs to fix

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

                              def self.up
                              change_table :contracts do |t|
                              t.remove :limit_hits
                              t.remove :limit_stored
                              t.remove :limit_transfer
                              db/migrate/20080731075548_remove_obsolte_columns_from_contracts.rb on lines 42..79

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

                              def self.down
                              change_table :contracts do |t|
                              t.string :limit_hits
                              t.string :limit_stored
                              t.string :limit_transfer
                              db/migrate/20080731075548_remove_obsolte_columns_from_contracts.rb on lines 2..39

                              Function disableInterface has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function disableInterface(){
                              function enable_checkboxes(){
                              checkboxes_disabled(false);
                              }
                               
                               
                              Severity: Major
                              Found in app/assets/javascripts/application.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language