bio-miga/miga-gui

View on GitHub

Showing 5 of 351 total issues

Method new_project has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def new_project
    v.new_window do |app, nv|
      if MiGA::MiGA.initialized?
        folder = app.ask_save_folder
        if folder.nil? or MiGA::Project.exist?(folder)
Severity: Minor
Found in lib/miga/gui/controller.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 report has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  def report
    header("\xC2\xBB " + c.project.name.unmiga_name)
    stack(margin:40) do
      @done_para = subtitle "Dataset tasks advance: "
      @done = 0.0
Severity: Minor
Found in lib/miga/gui/view.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 box has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def box(opts={}, &blk)
      flow(margin_bottom:5) do
        opts[:alpha] ||= 0.2
        opts[:side_line] ||= miga_blue
        opts[:background] ||= miga_blue(opts[:alpha])
Severity: Minor
Found in lib/miga/gui/view.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 open_project has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def open_project
    v.new_window do |app, nv|
      folder = app.ask_open_folder
      if folder.nil? or not MiGA::Project.exist?(folder)
        app.alert "Cannot find a MiGA project at #{folder}!" unless folder.nil?
Severity: Minor
Found in lib/miga/gui/controller.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 graphic_advance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def graphic_advance(ds, h=10)
      ds_adv = ds.profile_advance
      flow(width:30*MiGA::Dataset.PREPROCESSING_TASKS.size) do
        nostroke
        col = ["#CCC", rgb(119,130,61), rgb(160,41,50)]
Severity: Minor
Found in lib/miga/gui/view.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