Method properties
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def properties(title,hash,options={:edit=>false, :scroll=>[0,0]})
if ! defined?(@prop_index)
@prop_index=0
@prop_hash={}
else
- Read upRead up
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
File ruiby_dsl3.rb
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative 'ruiby_default_dialog3.rb'
module Ruiby_dsl
include ::Gtk
include ::Ruiby_default_dialog
end
Method properties
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def properties(title,hash,options={:edit=>false, :scroll=>[0,0]})
if ! defined?(@prop_index)
@prop_index=0
@prop_hash={}
else
Method video
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def video(url=nil,w=300,h=200)
begin
require "gst"
require "clutter-gtk" # gem install clutter-gtk
require "clutter-gst" # gem install clutter-gstreamer
Method calendar
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def calendar(time=Time.now,options={})
c = Calendar.new
#c.display_options(Calendar::SHOW_HEADING | Calendar::SHOW_DAY_NAMES |
# Calendar::SHOW_WEEK_NUMBERS )
after(1) { c.signal_connect("day-selected") { |w,e| options[:selection].call(w.day) rescue error($!) } } if options[:selection]
- Read upRead up
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 apply_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def apply_options(w,options)
w.set_size_request(*options[:size]) if options[:size]
w.set_border_width(options[:margins]) if options[:margins]
w.width_request=(options[:width].to_i) if options[:width]
w.height_request=(options[:height].to_i) if options[:height]
- Read upRead up
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 video
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def video(url=nil,w=300,h=200)
begin
require "gst"
require "clutter-gtk" # gem install clutter-gtk
require "clutter-gst" # gem install clutter-gstreamer
- Read upRead up
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_config
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_config(w)
return({"nil"=>""}) unless w && w.class.respond_to?("properties")
w.class.properties().inject({"class"=>w.class.to_s}) { |h,meth|
data=(w.send(meth) rescue nil)
h[meth]=data.inspect.gsub(/^#/,'')[0..32] if data
- Read upRead up
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"