Showing 209 of 263 total issues
Method <<
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def <<(a,b=nil,c=nil,d=nil)
if b==nil
Bbox === a ? add_bbox(a) : Array===a ? add_point(*a) : raise("error param bbox << ...")
elsif c==nil
add_point(a,b)
- 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 fentry
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fentry(value,option={},&blk)
# TODO Dyn
w=SpinButton.new(option[:min].to_f,option[:max].to_f,option[:by].to_f)
w.set_numeric(true)
w.set_value(value ? value.to_f : 0.0)
- 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"
Further reading
Method test_dialogues
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def test_dialogues()
$gheader=%w{id first-name last-name age str}
$gdata= (0..10000).to_a.map {|i| ("%d regis%d aubarede%d %d %s" % [i,i,i,i%99,("*"*(i%30))]).split(/\s+/) }
a=PopupTable.new("title of dialog",400,200,
$gheader,
- 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 component
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def component()
stack do
labeli(@title)
@form=properties("",@data,@popt) { |a| @bloc.call(a) if @bloc }
case @options["button-direction"]
- 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 snapshot
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def snapshot(filename=nil)
return unless RUBY_PLATFORM =~ /in.*32/
require 'win32/screenshot'
require 'win32ole'
- 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 _paned
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _paned(horizontal,size,fragment)
s=stack {} # create a temporary container for inner widgets
@lcur << s
yield()
autoslot
- 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 image
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def image(file,options={})
im=if File.exists?(file)
pix=get_pixmap(file)
pix=pix.scale(options[:width],options[:height],Gdk::Pixbuf::INTERP_BILINEAR) if options[:width] && options[:height]
pix=pix.scale(options[:size],options[:size],Gdk::Pixbuf::INTERP_BILINEAR) if options[:size]
- 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 set_as_bool
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_as_bool(v)
@value=case @value
when Numeric then v ? 1 : 0
when String then v ? "1" : ""
else !!v
- 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 trace
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def trace(*txt)
if $__mainthread__ && $__mainthread__ != Thread.current
gui_invoke { log(*txt) }
return
end
- 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 rposition
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def rposition(x,y)
if x==0 && y==0
set_window_position Gtk::WindowPosition::CENTER
return
elsif x>=0 && y>=0
- 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 color_choice
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def color_choice(text=nil,options={},&cb)
but,lab=nil,nil
out=flow {
but = button((text||"Color?...").to_s) do
c=ask_color
- 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
Avoid too many return
statements within this method. Open
return nil
Method gui_invoke
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gui_invoke(&blk)
if ! defined?($__mainwindow__)
puts("\n\ngui_invoke() : initialize() of main windows not done!\n\n")
return
end
- 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 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
- 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 fload
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fload(file,content)
if File.exists?(file) && content==nil
content=File.read(file)
end
return unless content!=nil
- 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 end_command
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def end_command(item)
lw=@lw.dup
@lw=[]
return if !item || item.size==0 || lw.size<1
puts " menu: #{item} ==> #{lw.join(' ')}"
- 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 test_table
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_table
frame("Forms",margins: 10,bg: "#FEE") { table(2,10,{set_column_spacings: 3}) do
row { cell_right(label "state") ; cell(button("set") { alert("?") }) }
row { cell_right label "speed" ; cell(entry("aa")) }
row { cell_right label "size" ; cell ientry(11,{:min=>0,:max=>100,:by=>1}) }
- 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 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 $!
- 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 load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load(file,content)
if File.exists?(file) && content==nil
content=File.read(file)
end
return unless content!=nil
- 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"