Showing 209 of 263 total issues
Method bbox
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cv.bbox(lxy)
xmin,ymin=lxy[0..1]
xmax,ymax=lxy[0..1]
lxy.each_slice(2) {|x,y|
xmin=x if x<xmin ;ymin=y if y<ymin
- 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 log
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def log(*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
Consider simplifying this complex logical expression. Open
if filename && px && py && bidon && dim && File.exist?(filename)
dim=dim.to_i
@cach_pix[filename]=Gdk::Pixbuf.new(:file =>filename) unless @cach_pix[filename]
x0= dim*px.to_i
y0= dim*py.to_i
Method toggle_button
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def toggle_button(text1,text2=nil,value=false,option={},&blk)
Method add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(noc,y0,y1,label,autoscale)
Method text
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def text(ctx,fs,x,y,text)
Method find_into_bbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_into_bbox(x0,y0,x1,y1,nolayer=1)
Method draw_bg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_bg(cr,w,h,c1,c2)
Method draw_border
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_border(ctx,x,y,pdx,pdy)
Method field
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def field(tlabel,lwidth,value,option={},&blk)
Method cscale
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def cscale(l,x,y,cx,cy=nil) trans(scale(trans(l,-x,-y),cx,cy),x,y) end
Method axes
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def axes(x0,maxx,maxy,pasx,pasy)
Method draw_border
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_border(ctx,x,y,pdx,pdy)
Method _dyn_toggle_button
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _dyn_toggle_button(text1,text2,var,option={},&blk)
Method find_cover_bbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_cover_bbox(x0,y0,x1,y1,nolayer=1)
Method draw_tree
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def draw_tree(cr,x1, y1, angle, depth)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(window,title="title?",config,x0,y0)
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 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"