raubarede/Ruiby

View on GitHub

Showing 263 of 263 total issues

Method plot_xyft has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def plot_xyft(t0,tmax,pas,xy,color="#000000",ep=2,&b)
Severity: Major
Found in samples/canvas.rb - About 50 mins to fix

    Method draw_curve1 has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def draw_curve1(curve,i,x0,y0,unit, type, vy)
    Severity: Major
    Found in samples/gadget_trading.rb - About 50 mins to fix

      Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(noc,min,max,label,dxlabel,auto_scale)
      Severity: Minor
      Found in samples/pipeplot.rb - About 45 mins to fix

        Method draw_tile has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def draw_tile(ctx,f,x,y,pdx,pdy)
        Severity: Minor
        Found in samples/tilesviewer.rb - About 45 mins to fix

          Method draw_tile has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def draw_tile(ctx,f,x,y,pdx,pdy)
          Severity: Minor
          Found in samples/aerial_viewer.rb - About 45 mins to fix

            Method _dyn_ientry has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def _dyn_ientry(var,options,slotied) 
                w= unless slotied
                  (block_given? ? ientry(var.value,options)  : ientry(var.value,options) { |v| var.value=v })
                else
                  (block_given? ? ientry(var.value,options)  : ientry(var.value,options) { |v| var.value=v })
            Severity: Minor
            Found in lib/ruiby_gtk/dsl/form_fields.rb - About 45 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 pt_in_bbox? has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def pt_in_bbox?(x,y, x0,y0,x1,y1)
            Severity: Minor
            Found in samples/draw.rb - About 45 mins to fix

              Method combo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def combo(choices,default=nil,option={},&blk)
                  # TODO Dyn
                  w=ComboBoxText.new()
                  choices=choices.inject({}) { |h,k| 
                    h[k]=h.size
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/form_fields.rb - About 45 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 calc_alarme has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def calc_alarme(cote,values)
               return [false,false] unless values["last"]
               value=values["last"].to_f
               p1=cote[:param1]
               p2=cote[:param2]
              Severity: Minor
              Found in samples/gadget_trading.rb - About 45 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 panel_progress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

               def panel_progress(text="",&blk) 
                   dvar= ::DynVar.new(0)
                   lw=nil
                   d=panel_async("Progression...") {
                       lw=label text if text && text.size >0
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/form_fields.rb - About 45 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 run2 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def run2
                  ii=0
                  sleep 30
                  loop {
                      Open3.popen3("ping 10.177.235.1") { |si,so,se|
              Severity: Minor
              Found in samples/testth.rb - About 45 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 main has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def main(ss)
               
                lth=[]
                no=0
                Dir.mkdir('mstat') unless Dir.exists?('mstat')
              Severity: Minor
              Found in tmp/gemstat.rb - About 45 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 register_value has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def register_value(data)
                      if data.is_a? Array
                          svalue=data[@noc]
                          return if !svalue || svalue !~ /[\d.]+/
                          @value=svalue.to_f
              Severity: Minor
              Found in samples/pipeplot.rb - About 45 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 test_crud has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def test_crud()
                  stack do
                    $gheader=%w{id first-name last-name age}
                    $gdata=[%w{regis aubarede 12},%w{siger ederabu 21},%w{baraque aubama 12},%w{ruiby ruby 1}]
                    i=-1; $gdata.map! { |l| i+=1; [i]+l }
              Severity: Minor
              Found in samples/test.rb - About 45 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 islider has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def islider(value=0,option={},&b)
                  if DynVar === value
                    return _dyn_islider(value,option,&b)
                  end
                  w=Scale.new(:horizontal,(option[:min]||0).to_i,(option[:max]||100).to_i,option[:by]||1)
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/form_fields.rb - About 45 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 draw_rounded_rectangle has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def cv.draw_rounded_rectangle(x0,y0,w,h,ar,colorStroke,colorFill,widthStroke)
                    cv,cr=@currentCanvasCtx
                    pi=Math::PI
                    ar=[ar,ar,ar,ar] if ar.kind_of?(Numeric)
                    if Array === colorFill
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/canvas.rb - About 45 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 add_curve has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                   def plot.add_curve(name,config) 
                      c=config.dup
                      c[:type] = :curve
                      c[:data] ||= [[0,0],[100,100]]
                      c[:maxlendata] ||= c[:data].size
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/plot.rb - About 45 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 fslider has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                def fslider(value=0,option={},&b)
                  if DynVar === value
                    return _dyn_fslider(value,option,&b)
                  end
                  w=Scale.new(:horizontal,option[:min],option[:max],option[:by])
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/label_button_image.rb - About 45 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 _draw_poly has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def cv._draw_poly(lxy,color_fg,color_bg,width)
                      raise("odd number of coord for lxy") if !lxy || lxy.size==0 || lxy.size%2==1
                      w,cr=@currentCanvasCtx
                      cr.set_line_width(width) if width
                      x0,y0,*poly=*lxy
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/canvas.rb - About 45 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 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
              Severity: Minor
              Found in lib/ruiby_gtk/dsl/commands.rb - About 45 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

              Severity
              Category
              Status
              Source
              Language