Showing 209 of 263 total issues
Method formula
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def formula(opoids,poids)
#--#
opoids>30 ? (opoids<82 ? (poids*1.0003) : poids*0.99 ) : ((opoids<10 && opoids>1) ? (100-poids/2) : (poids*0.93))
#--#
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 dialog_chooser
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def dialog_chooser(title, action, button)
if Ruiby.gtk_version(3)
dialog = Gtk::FileChooserDialog.new(
:title => title,
:parent => self,
- 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 dialog_chooser
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def dialog_chooser(title, action, button)
if Ruiby.gtk_version(3)
dialog = Gtk::FileChooserDialog.new(
:title => title,
:parent => self,
- 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 initialize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def initialize(window,title="title?",config,x0,y0)
$statusIcon=self
@popup_tray=Menu.new
@checkMenu={}
file= (config[:icon] && File.exist?(config[:icon])) ? config[:icon] : 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 test_list_grid
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_list_grid()
flow {
stack {
frame("CB on List") {
stacki{
Method test_canvas
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_canvas()
flow do
stack do
button("Color") {
@color=ask_color()
Method threader
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def threader(per)
return unless $__mainwindow__==self
@queue=Queue.new
$__queue__=@queue
ici=self
- 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 push_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def push_data(h)
h.each_with_index {|(k,v),i|
next unless Hash === v
begin
@lcurve[k]=[[100]*150,[100]*150] unless @lcurve[k] && @lcurve[k].size==2
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def component()
stack do
if ed=source_editor()
@edit=slot(ed).editor
@edit.buffer.text=File.exists?(@filename) ? File.read(@filename) : @filename
- 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 run_window
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def run_window()
Ruiby.app width: $W, height: $H, title: "Curve" do
fn=Ruiby::MEDIA+"/famfamfam/chart_curve.png"
set_icon(fn) if File.exists?(fn)
set_resizable(true)
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def component()
stack do
flow {
stacki { space;_button_list;space } if @options["button-orrient"] =~ /^l/i
@grid=grid(@captions,100,150)
- 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 do_special_actions
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_special_actions()
10.times { |i| log("#{i} "+ ("*"*(i+1))) }
dialog("Dialog tests") do
stack do
labeli " alert, prompt, file chosser and log "
Method component
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def component()
stack do
htoolbar_with_icon_text do
button_icon_text "open","Open file..." do
load(ask_file_to_read(".","*.rb"),nil)
Method initialize
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(title,w,h)
super()
$app=self unless defined?($app)
init_threader()
#threader(10) # must be call by user window, if necessary
Method _radio_buttons
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _radio_buttons(sens,ltext=["empty!"],value=-1,&blk)
is_dyn = (DynVar === value)
b0=nil
s=var_box(sens,{},false) {
ltext.each_with_index {|txt,i|
Method initialize
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(window,title="title?",config,x0,y0)
$statusIcon=self
@popup_tray=Menu.new
@checkMenu={}
file= (config[:icon] && File.exist?(config[:icon])) ? config[:icon] : nil
Method expose
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def expose(cv,ctx)
ssize=cv.get_size_request()
############## Liste
@cv.draw_rectangle(0,0,ssize.first,ssize.last,0,nil,"#888",0)
@cv.draw_rectangle(2,2,ssize.first-4,ssize.last-4,15,"#555",$BG,3)
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
Method toggle_button
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def toggle_button(text1,text2=nil,value=false,option={},&blk)
if DynVar === value
return _dyn_toggle_button(text1,text2,value,option,&blk)
end
text2 = "- "+text1 unless text2
- 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 exec
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def exec(l)
@stop=false
l.each_with_index do |s,index|
gui_invoke { @list.set_selection(index) }
timeout(10) {
- 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"