tmecklem/shipmate

View on GitHub

Showing 2 of 2 total issues

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

  def app_names(app_dir)
    app_type = app_dir == @ios_dir ? IOS_APP_TYPE : ANDROID_APP_TYPE
    subdirectories(app_dir).sort.select do |app_name|
      app_builds = self.app_builds(app_name,app_dir,app_type)

Severity: Minor
Found in app/controllers/apps_controller.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 device_families has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def device_families
    families = info_plist_hash["UIDeviceFamily"].map do |family_id|
      if family_id == 1 
        :iphone
      elsif family_id == 2
Severity: Minor
Found in app/models/ios_build.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