3scale/porta

View on GitHub

Showing 5,205 of 5,561 total issues

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

markCurrentPlan: function(planPreviewBoxId){
var box = $('#' + planPreviewBoxId);
 
var $current = box.find('div.plan-preview[data-plan-id="' + this.currentPlan + '"]');
$(".current-plan-notice").hide();
Severity: Major
Found in lib/developer_portal/app/assets/javascripts/plans_widget.js and 1 other location - About 6 hrs to fix
lib/developer_portal/app/assets/javascripts/plans_widget_v2.js on lines 37..50

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

markCurrentPlan: function(planPreviewBoxId){
var box = $('#' + planPreviewBoxId);
 
var $current = box.find('div.plan-preview[data-plan-id="' + this.currentPlan + '"]');
$(".current-plan-notice").hide();
lib/developer_portal/app/assets/javascripts/plans_widget.js on lines 26..39

Class Account has 43 methods (exceeds 20 allowed). Consider refactoring.
Open

class Account < Drops::Model
 
info %{
A developer account. See `User` drop if you are looking for the email addresses or similar information.
}
Severity: Minor
Found in lib/developer_portal/lib/liquid/drops/account.rb - About 5 hrs to fix

    File account.rb has 405 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class Account < ApplicationRecord
    attribute :credit_card_expires_on, :date
    self.ignored_columns = %i[proxy_configs_file_name proxy_configs_content_type proxy_configs_file_size
    proxy_configs_updated_at proxy_configs_conf_file_name proxy_configs_conf_content_type
    proxy_configs_conf_file_size proxy_configs_conf_updated_at]
    Severity: Minor
    Found in app/models/account.rb - About 5 hrs to fix

      Method error_messages_for has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
      Open

      def error_messages_for(*params)
      ignore_me = ['Account is invalid', 'Bought cinstances is invalid']
      options = params.extract_options!.symbolize_keys
       
      objects = if object = options.delete(:object)
      Severity: Minor
      Found in app/helpers/application_helper.rb - About 5 hrs to fix

      File 20100125103539_browser_cms_tables.rb has 398 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class BrowserCmsTables < ActiveRecord::Migration
      def self.up
      create_table "attachment_versions", :force => true do |t|
      t.integer "attachment_id"
      t.integer "version"
      Severity: Minor
      Found in db/migrate/20100125103539_browser_cms_tables.rb - About 5 hrs to fix

        File user.rb has 390 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'digest/sha1'
         
        class User < ApplicationRecord
        include Symbolize
         
         
        Severity: Minor
        Found in app/models/user.rb - About 5 hrs to fix

          Class Application has 40 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class Application < Drops::Contract
          drop_example "Using application drop in liquid.", %{
          <h1>Application {{ application.name }} (<span title="Application ID">{{ application.application_id }}</span>)</h1>
          <p>{{ application.description }}</p>
          }
          Severity: Minor
          Found in lib/developer_portal/lib/liquid/drops/application.rb - About 5 hrs to fix

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

            showPlan: function(previewBoxId, planID){
            var box = $('#' + previewBoxId);
             
            if(typeof(planID) == 'undefined'){
            planID = this.currentPlan;
            Severity: Major
            Found in lib/developer_portal/app/assets/javascripts/plans_widget.js and 1 other location - About 5 hrs to fix
            lib/developer_portal/app/assets/javascripts/plans_widget_v2.js on lines 57..69

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

            showPlan: function(previewBoxId, planID){
            var box = $('#' + previewBoxId);
             
            if(typeof(planID) == 'undefined'){
            planID = this.currentPlan;
            lib/developer_portal/app/assets/javascripts/plans_widget.js on lines 46..58

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

            def self.up
            create_table :blogs do |t|
            t.string :name
            t.string :format
            t.text :template
            Severity: Major
            Found in db/migrate/20100216080646_cms_blog.rb - About 5 hrs to fix

              Class BillingStrategy has 37 methods (exceeds 20 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 4 hrs to fix

                Method charge! has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                def charge!(automatic = true)
                ensure_payable_state!
                 
                unless chargeable?
                logger.info "Not charging invoice #{id} (buyer #{buyer_account_id}), reason: #{reason_cannot_charge}"
                Severity: Minor
                Found in app/models/invoice.rb - About 4 hrs to fix

                Method clause has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                def clause(*args)
                model = (args.length >= 2 ? args[0] : nil)
                is_delta = (args.length >= 2 ? args[1] : args[0]) || false
                 
                table_name = (model.nil? ? adapter.quoted_table_name : model.quoted_table_name)
                Severity: Minor
                Found in config/initializers/oracle.rb - About 4 hrs to fix

                Class NotificationMailer has 35 methods (exceeds 20 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 4 hrs to fix

                  Method down has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def self.down
                  create_table "credit_transactions", :force => true do |t|
                  t.integer "account_id"
                  t.string "kind", :default => "incoming"
                  t.string "currency", :default => "EUR", :null => false
                  Severity: Major
                  Found in db/migrate/20111128090920_dumping_unused_tables.rb - About 4 hrs to fix

                    File cinstance.rb has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    class Cinstance < Contract
                    include SaveDestroyForServiceAssociation
                    # Maximum number of cinstances permitted between provider and buyer
                    MAX = 10
                     
                     
                    Severity: Minor
                    Found in app/models/cinstance.rb - About 4 hrs to fix

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

                      def to_xml(options = {})
                      xml = options[:builder] || ThreeScale::XML::Builder.new
                       
                      xml.status do |xml|
                      xml.plan(plan_name) if plan_name
                      Severity: Minor
                      Found in app/models/backend/status.rb - About 4 hrs to fix

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

                      class Urls < Drops::Base
                      allowed_name :urls
                       
                      attr_reader :provider
                      protected :provider
                      Severity: Minor
                      Found in lib/developer_portal/lib/liquid/drops/urls.rb - About 4 hrs to fix

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

                        def to_xml(options = {})
                        result = options[:builder] || ThreeScale::XML::Builder.new
                         
                        result.application do |xml|
                        unless new_record?
                        Severity: Minor
                        Found in app/models/cinstance.rb - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language