raubarede/Ruiby

View on GitHub
lib/ruiby_gtk/dsl/list_grid.rb

Summary

Maintainability
C
1 day
Test Coverage

Method list has 73 lines of code (exceeds 25 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: Major
Found in lib/ruiby_gtk/dsl/list_grid.rb - About 2 hrs to fix

    Method tree_grid has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def tree_grid(names,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: Major
    Found in lib/ruiby_gtk/dsl/list_grid.rb - About 2 hrs to fix

      Method grid has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def grid(names,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 1 hr to fix

        Method set_row has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def scrolled_win.set_row(data,parent=nil)
              puts "treeview: raw data size nok : #{data.size}/#{data.inspect}" if data.size!=@types.size
              i=0
              c=self.model.append(parent)
              data.zip(@types) do |item,clazz|
        Severity: Minor
        Found in lib/ruiby_gtk/dsl/list_grid.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 tree_grid has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          def tree_grid(names,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 55 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 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

        There are no issues that match your filters.

        Category
        Status