MohawkApps/Textables

View on GitHub

Showing 6 of 6 total issues

Method download_data has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  def download_data
    return if !should_download_data?

    # mp file_name.document_path

Severity: Minor
Found in app/api/textable_data.rb - About 3 hrs 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 kanjify has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def kanjify
    char_table = {
      'a' => 'ム',
      'b' => '乃',
      'c' => 'c',
Severity: Minor
Found in app/unholy/string.rb - About 1 hr to fix

    Method upside_down has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def upside_down
        char_table = {
          'a' => 'ɐ',
          'b' => 'q',
          'c' => 'ɔ',
    Severity: Minor
    Found in app/unholy/string.rb - About 1 hr to fix

      Method email_me has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def email_me
          BW::Mail.compose({
            delegate: self,
            to: 'mark@mohawkapps.com',
            subject: "#{App.name} App Feedback",
      Severity: Minor
      Found in app/screens/concerns/opensource_cells.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 application has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def application(application, didFinishLaunchingWithOptions:launchOptions)
          return true if RUBYMOTION_ENV == 'test'
      
          BW.debug = true unless App.info_plist['AppStoreRelease'] == true
      
      
      Severity: Minor
      Found in app/app_delegate.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 should_download_data? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def should_download_data?
          if (App::Persistence['motion_takeoff_launch_count'].nil? || App::Persistence['motion_takeoff_launch_count'] < 2) && !Device.simulator?
            false
          else
            ((Device.simulator?) ? 20.seconds.ago.to_i : 1.days.ago.to_i) > download_age
      Severity: Minor
      Found in app/api/textable_data.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

      Severity
      Category
      Status
      Source
      Language