satoyos/Shuffle100

View on GitHub

Showing 26 of 41 total issues

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

  def confirm_user_to_review
    UIAlertView.alert('このアプリを評価するために、App Storeアプリを立ち上げますか?',
                      buttons: ['立ち上げる', 'やめておく']
    ) do |button, button_index|
      if button == '立ち上げる'
Severity: Minor
Found in app/screens/help_menu_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 confirm_user_to_quit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def confirm_user_to_quit
    UIAlertView.alert('試合を終了しますか?',
                      buttons: ['終了する', '続ける']
    ) do |button, button_index|
      if button == '終了する'
Severity: Minor
Found in app/delegates/game_quit_delegate.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 set_up_header_footer_views has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def set_up_header_footer_views
      [:header, :footer].each do |hf_view|
        if self.respond_to?("table_#{hf_view}_view".to_sym)
          view = self.send("table_#{hf_view}_view")
          if view.is_a? UIView
Severity: Minor
Found in app/lib/table_screen_patches/table_patch.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 select_from_bool100 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def select_from_bool100(bool100)
    raise 'use array[100] for select_from_bool100:' unless bool100.size == 100
    raise "number of poems in deck => #{@poems.size}" unless @poems.size == 100
    poems = []
    @poems.each_with_index do |poem, idx|
Severity: Minor
Found in app/models/deck.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 actions_for_save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def actions_for_save
    actions = [
        {
            title: '新しい札セットとして保存する',
            handler: Proc.new {|obj|
Severity: Minor
Found in app/delegates/poem_picker_delegate.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 pushed_button_of_color has a Cognitive Complexity of 6 (exceeds 5 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 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