satoyos/Shuffle100

View on GitHub

Showing 26 of 41 total issues

File table_patch.rb has 326 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module ProMotion
  module Table
    include ProMotion::Styling
    include ProMotion::Table::Searchable
    include ProMotion::Table::Refreshable
Severity: Minor
Found in app/lib/table_screen_patches/table_patch.rb - About 3 hrs to fix

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

        def search(search_string)
          @filtered = true
          @search_string = search_string
          self.filtered_data = []
    
    
    Severity: Minor
    Found in app/lib/table_screen_patches/table_data_patch.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 def_instance_delegator has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      def def_instance_delegator(accessor, method, ali = method)
        accessor = accessor.id2name if accessor.kind_of?(Integer)
        method = method.id2name if method.kind_of?(Integer)
        ali = ali.id2name if ali.kind_of?(Integer)
        activity = Proc.new do
    Severity: Minor
    Found in app/lib/forwardable.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 pushed_button_of_color has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def pushed_button_of_color(color_sym)
        puts "+ 「#{str_of_color(color_sym)}グループ」ボタンが押された!" if BW2.debug?
        alert = UIAlertController.alertControllerWithTitle(
            "#{str_of_color(color_sym)}色の20首をどうしますか?",
            message: nil,
    Severity: Minor
    Found in app/screens/five_colors_screen.rb - About 1 hr to fix

      Method how_to_use_cells has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def how_to_use_cells
          [
              {
                  title: '設定できること',
                  action: :open_options_help,
      Severity: Minor
      Found in app/dataSources/help_menu_screen_data_source.rb - About 1 hr to fix

        Method webView has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def webView(webView, shouldStartLoadWithRequest: request, navigationType: navigationType)
            if navigationType == UIWebViewNavigationTypeLinkClicked ||
                navigationType == UIWebViewNavigationTypeOther
              url = request.URL.absoluteString
              puts "[[[ REQUEST URL]]] => #{url}" if BW2.debug?
        Severity: Minor
        Found in app/screens/info_screen.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 get_searchable_params has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              def get_searchable_params
                params = self.class.get_searchable_params.dup
        
                # support camelCase params
                params[:search_results_updater] ||= params[:searchResultsUpdater]
        Severity: Minor
        Found in app/lib/table_screen_patches/searchable_patch.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 tableView has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def tableView(_, heightForFooterInSection: index)
              section = promotion_table_data.section(index)
              if section[:footer_view] || section[:footer].to_s.length > 0
                if section[:footer_view_height]
                  section[:footer_view_height]
        Severity: Minor
        Found in app/lib/table_screen_patches/table_patch.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 set_button_actions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def set_button_actions
            layout.get(:refrain_button).on(:touch){
              puts '+ 「もう1回下の句」ボタンが押された!' if BW2.debug?
              close(next: :refrain)
            }
        Severity: Minor
        Found in app/screens/whats_next_screen.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 tableView has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def tableView(_, heightForHeaderInSection: index)
              section = promotion_table_data.section(index)
              if section[:title_view] || section[:title].to_s.length > 0
                if section[:title_view_height]
                  section[:title_view_height]
        Severity: Minor
        Found in app/lib/table_screen_patches/table_patch.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 initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def initialize(init_hash={})
            if init_hash[:deck]
              puts '- PoemSupplierを、deckを指定する形で初期化しました。' if BW2.debug?
              @deck = init_hash[:deck]
              return
        Severity: Minor
        Found in app/models/poem_supplier.rb - About 55 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 selected_status_of_char has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def selected_status_of_char(sym)
            raise "Invalid argument type #{sym}" unless sym.is_a?(Symbol)
            numbers = NGramNumbers.of(sym)
            raise "Couldn't get NgramNumbers for #{sym}" unless numbers
            if numbers.inject(true){|result, num| result &&= @status100.of_number(num)}
        Severity: Minor
        Found in app/delegates/n_gram_picker_delegate.rb - About 55 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 def_single_delegator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def def_single_delegator(accessor, method, ali = method)
            instance_eval do
              define_method("#{ali}") do |*args, &block|
                begin
                  instance_variable_get(accessor).__send__(method, *args, &block)
        Severity: Minor
        Found in app/lib/forwardable.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 resized_image_of_name has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def  resized_image_of_name(img_file_name, square_size: height)
              @image_hash = {} unless @image_hash
              return @image_hash[img_file_name] if @image_hash[img_file_name]
              puts "[#{img_file_name}]から画像を読み込んで、UIImageを作ります。" if BW2.debug?
              @image_hash[img_file_name] =
        Severity: Minor
        Found in app/views/whats_next_button.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 selected_status_of_color has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def selected_status_of_color(color_sym)
            raise "Invalid argument type #{color_sym}" unless color_sym.is_a? Symbol
            numbers = numbers_of_color(color_sym)
            raise "Couldn't get Numbers for Color [#{color_sym}]" if numbers.empty?
            if numbers.inject(true){|result, num| result &&= status100.of_number(num)}
        Severity: Minor
        Found in app/screens/five_colors_screen.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 delete_row has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def delete_row(index_paths, animation = nil)
              deletable_index_paths = []
              index_paths = [index_paths] if index_paths.kind_of?(NSIndexPath)
              index_paths.each do |index_path|
                delete_cell = false
        Severity: Minor
        Found in app/lib/table_screen_patches/table_patch.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 on_long_press has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

              def on_long_press(gesture)
                return unless gesture.state == UIGestureRecognizerStateBegan
                gesture_point = gesture.locationInView(pressed_table_view)
                index_path = pressed_table_view.indexPathForRowAtPoint(gesture_point)
                return unless index_path
        Severity: Minor
        Found in app/lib/table_screen_patches/longpressable_patch.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 make_searchable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

              def make_searchable(params = nil) # params argument is deprecated. No longer need to use it.
                params = get_searchable_params
        
                self.definesPresentationContext = true
                search_controller.delegate = params[:delegate]
        Severity: Minor
        Found in app/lib/table_screen_patches/searchable_patch.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 audioPlayerDidFinishPlaying has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def audioPlayerDidFinishPlaying(player, successfully: flag)
            return unless flag
        
            puts '- 読み上げが無事に終了!(初心者モード)' if BW2.debug?
            layout.play_finished_successfully
        Severity: Minor
        Found in app/screens/beginner_recite_screen.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

        Method stop has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def stop
            raise 'Any recording process started' unless @pid
        
            # 録画終了
            # たまに"No such process"で失敗するので、そのエラーはrescueで無視する。
        Severity: Minor
        Found in appium_tests/lib/recorder.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