raubarede/Ruiby

View on GitHub

Showing 209 of 263 total issues

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

      ;  def set_selected(indice)
        b0.group.reverse.each_with_index { |w,index| 
         if !w.active? && indice.to_i==index
           puts "setsel #{index}"
           w.set_active(true) rescue p $!
Severity: Minor
Found in lib/ruiby_gtk/dsl/form_fields.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 gui_invoke_in_window has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def gui_invoke_in_window(w,&blk) 
  if ! defined?($__mainwindow__)
    puts("\n\ngui_invoke() : initialize() of main windows not done!\n\n") 
    return
  end
Severity: Minor
Found in lib/ruiby_gtk/ruiby_threader.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 get_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_data()
 start=Time.now
 if $lexclude.size==0
   $lexclude=Hash[*Gems.most_downloaded.map {|a| 
      [a.first['full_name'].split('-').first.gsub('_',' '),1]
Severity: Minor
Found in samples/gadget.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_data has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def scrolled_win.set_data(hdata,parent=nil,first=true)
      raise("tree.set_data() out of main thread!")if $__mainthread__ != Thread.current
      if parent==nil && first
        @ruiby_data=hdata
        model.clear()
Severity: Minor
Found in lib/ruiby_gtk/dsl/list_grid.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 slot_append_after has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def slot_append_after(w,wref)
    if $__mainthread__ != Thread.current
      gui_invoke { slot_append_after(w,wref) }
      return
    end
Severity: Minor
Found in lib/ruiby_gtk/dsl/commands.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 get_stockicon_pixbuf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def get_stockicon_pixbuf(name)
    begin
      icn="#{name.downcase.gsub('_','-')}"
      return Gtk::IconTheme.default().load_icon(icn,16,0)
    rescue Exception => ee
Severity: Minor
Found in lib/ruiby_gtk/dsl/pixmap.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 list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def list(title,w=0,h=0,options={})
    scrolled_win = Gtk::ScrolledWindow.new
    scrolled_win.set_policy(:automatic ,:automatic )
    scrolled_win.set_width_request(w) if w>0
    scrolled_win.set_height_request(h)  if h>0
Severity: Minor
Found in lib/ruiby_gtk/dsl/list_grid.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 on_canvas_button_motion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def on_canvas_button_motion(&blk )
    _accept?(:handler)
    @currentCanvas.signal_connect('motion_notify_event')  { |w,e| 
      next unless w.get_memo()
      w.set_memo(blk.call(w,e,w.get_memo)) rescue error($!)
Severity: Minor
Found in lib/ruiby_gtk/dsl/canvas.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 slot_append_before has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def slot_append_before(w,wref)
    if $__mainthread__ != Thread.current
      gui_invoke { slot_append_before(w,wref) }
      return
    end
Severity: Minor
Found in lib/ruiby_gtk/dsl/commands.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