hello-gem/hello

View on GitHub

Showing 310 of 310 total issues

Assignment Branch Condition size for parse is too high. [26.44/15]
Open

      def parse(user_agent_string)
        obj = user_agent_parser.parse(user_agent_string)
        a_browser = obj.to_s
        a_os = obj.os.to_s
        a_browser = "#{obj.name} #{obj.version && obj.version.major}".strip
Severity: Minor
Found in lib/hello/utils/device_name.rb by rubocop

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

Assignment Branch Condition size for create_layout_file is too high. [24.82/15]
Open

  def create_layout_file
    destination = 'app/views/layouts/application.html.erb'

    answer = ask('Replace application.html.erb automatically? [Yn]')
    answer_yes = answer.blank? || answer.downcase.starts_with?('y')

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. [49/25]
Open

Hello::Engine.routes.draw do
  # root 'management/profiles#show'

  #
  # REGISTRATION
Severity: Minor
Found in 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.

Method has too many lines. [15/10]
Open

  def create_layout_file
    destination = 'app/views/layouts/application.html.erb'

    answer = ask('Replace application.html.erb automatically? [Yn]')
    answer_yes = answer.blank? || answer.downcase.starts_with?('y')

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.

Method has too many lines. [14/10]
Open

      def destroy
        @cancel_account = Business::Management::CancelAccount.new(current_user)

        if @cancel_account.cancel_account
          flash[:notice] = @cancel_account.success_message

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 destroy is too high. [19.26/15]
Open

      def destroy
        @cancel_account = Business::Management::CancelAccount.new(current_user)

        if @cancel_account.cancel_account
          flash[:notice] = @cancel_account.success_message

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

Method has too many lines. [14/10]
Open

      def parse(user_agent_string)
        obj = user_agent_parser.parse(user_agent_string)
        a_browser = obj.to_s
        a_os = obj.os.to_s
        a_browser = "#{obj.name} #{obj.version && obj.version.major}".strip
Severity: Minor
Found in lib/hello/utils/device_name.rb by rubocop

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.

Method has too many lines. [14/10]
Open

  def copy_locales
    case
    when selected_locales == []
      puts_usage
      puts

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 update is too high. [17.06/15]
Open

      def update
        @password_credential.password = password_credential_params[:password]
        # @password_credential.password_confirmation = password_credential_params[:password_confirmation] if password_credential_params[:password_confirmation]

        if @password_credential.save

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

Method has too many lines. [12/10]
Open

      def update
        @password_credential.password = password_credential_params[:password]
        # @password_credential.password_confirmation = password_credential_params[:password_confirmation] if password_credential_params[:password_confirmation]

        if @password_credential.save

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 copy_locales is too high. [16.28/15]
Open

  def copy_locales
    case
    when selected_locales == []
      puts_usage
      puts

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

Assignment Branch Condition size for update is too high. [16.06/15]
Open

      def update
        business = Business::Internationalization::UpdateLocale.new(params['locale'])

        current_user && current_user.update!(locale: business.locale)
        use_locale(business.locale)

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

Assignment Branch Condition size for update is too high. [16.06/15]
Open

      def update
        if @user_business.update(user_params)
          use_locale(current_user.locale)
          flash[:notice] = @user_business.success_message
          respond_to do |format|

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

Cyclomatic complexity for current_access is too high. [7/6]
Open

      def current_access
        @current_access ||= begin
          return nil unless string  = param || header
          return nil unless user_id = string.split('-').first
          return nil unless user    = ::User.find_by_id(user_id)

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

Method has too many lines. [11/10]
Open

      def to_sign_in
        respond_to do |format|
          format.html do
            hello_store_url_on_session!
            redirect_to hello.sign_in_path

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.

Method has too many lines. [11/10]
Open

        def authenticate(login, password)
          @ignited = true
          @login = login
          @password = password

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 hello_around_action is too high. [16.06/15]
Open

    def hello_around_action(&block)
      use_locale(nil)

      if current_user
        # begin keep-alive
Severity: Minor
Found in lib/hello/rails_controller.rb by rubocop

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

Assignment Branch Condition size for continue is too high. [15.03/15]
Open

  def continue
    respond_to do |format|
      if update(params[:role])
        format.html { redirect_to root_path, notice: 'Welcome!' }
        format.json { render json: { user: current_user.as_json_web_api }, status: :ok }

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. [28/25]
Open

  scope module: 'management' do
    resources :accesses, only: [:index, :destroy]

    root 'profiles#show'
    resource :profile, only: [:show, :update, :destroy] do
Severity: Minor
Found in 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.

Avoid too many return statements within this method.
Open

          return nil unless model.active_token_or_destroy
Severity: Major
Found in lib/hello/request_manager/stateless.rb - About 30 mins to fix
Severity
Category
Status
Source
Language