raubarede/Ruiby

View on GitHub

Showing 263 of 263 total issues

Method execute has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

  def execute(line=nil)
    line||=get_line
    line=line.strip
    return if line.size==0
    
Severity: Minor
Found in lib/ruiby_gtk/ruiby_terminal.rb - About 2 hrs 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 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
Severity: Minor
Found in lib/ruiby_gtk/ruiby_dsl3.rb - About 2 hrs 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 get_pixbuf has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

  def get_pixbuf(name)
    @cach_pix={} unless defined?(@cach_pix)
    if @cach_pix.size>100
      puts "purge cached pixbuf (>100)"
      @cach_pix={}
Severity: Minor
Found in lib/ruiby_gtk/dsl/pixmap.rb - About 2 hrs 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

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
Severity: Minor
Found in lib/ruiby_gtk/ruiby_dsl3.rb - About 2 hrs to fix

    Method execute has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def execute(line=nil)
        line||=get_line
        line=line.strip
        return if line.size==0
        
    Severity: Major
    Found in lib/ruiby_gtk/ruiby_terminal.rb - About 2 hrs to fix

      Method draw_varbarr has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          def cv.draw_varbarr(x0,y0,x1,y1,dmin,dmax,lvalues0,width,&b)
            ax=1.0*(x1-x0)/(dmax-dmin) ;bx= x0-ax*dmin 
            ay=1.0*(y1-y0)/(dmax-dmin) ;by= y0-ay*dmin 
            xconv=proc {|d| (x1==x0) ? x1 :  (ax*d+bx) }
            yconv=proc {|d| (y1==y0) ? y1 :  (ay*d+by) }
      Severity: Minor
      Found in lib/ruiby_gtk/dsl/canvas.rb - About 2 hrs 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 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
      Severity: Major
      Found in lib/ruiby_gtk/ruiby_dsl3.rb - About 2 hrs to fix

        File canvas.rb has 268 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'timeout'
        require_relative '../lib/Ruiby'
        
        # Usage
        # CanvasBinding.eval_in(cv) {}
        Severity: Minor
        Found in samples/canvas.rb - About 2 hrs to fix

          Method read has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def read(t0,t1,lcotes)
                date0,date1=t0.gmtime.strftime("%Y_%m"),t1.gmtime.strftime("%Y_%m")
                t0gmt,t1gmt=t0.gmtime.to_i,t1.gmtime.to_i
                lvalues=(0..lcotes.size-1).map {[]}
                (date0..date1).each do |date| 
          Severity: Minor
          Found in samples/gadget_trading.rb - About 2 hrs 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 expose has a Cognitive Complexity of 18 (exceeds 5 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)
          Severity: Minor
          Found in samples/gadget.rb - About 2 hrs 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 expose_trading has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

            def expose_trading(cv,ctx)
              return if $hcotes.size<1
              top=Time.now
              @sx,@sy=size()
              @wcurve=@sx/@nb_col
          Severity: Minor
          Found in samples/gadget_trading.rb - About 2 hrs 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 axe has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

            def  axe(min,max,pas,sens)
              x0=20
              x1=15
              l=[]; l << [x0,x0]
              (min+2*x0).step(max,pas) { |v|
          Severity: Minor
          Found in samples/canvas.rb - About 2 hrs 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 expose_trading has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def expose_trading(cv,ctx)
              return if $hcotes.size<1
              top=Time.now
              @sx,@sy=size()
              @wcurve=@sx/@nb_col
          Severity: Major
          Found in samples/gadget_trading.rb - About 2 hrs to fix

            File pipeplot.rb has 264 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require_relative '../lib/Ruiby'
            
            #require 'Ruiby'
            
            $bgcolor=Ruiby_dsl.html_color("#023")
            Severity: Minor
            Found in samples/pipeplot.rb - About 2 hrs to fix

              Method test_canvas_draw has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def test_canvas_draw()
                  stack do
                    canvas(400,300) do
                      on_canvas_draw do |cv,cr|
                        cv.draw_pie(
              Severity: Major
              Found in samples/test.rb - About 2 hrs to fix

                Method do_dialog has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                  def do_dialog() 
                    l=@licones_name.grep(/#{@e.text}/) 
                    if l.size==0
                      alert("no found *#{@e.text}*")
                      return
                Severity: Minor
                Found in samples/icones.rb - About 2 hrs 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 _exe_windows has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                  def _exe_windows(cmd,to)
                    Thread.new(cmd,to) do |cmd,to|
                    begin
                      STDOUT.sync = true
                      process=nil
                Severity: Minor
                Found in lib/ruiby_gtk/dsl/script.rb - About 2 hrs 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 show has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def show(app)
                      app.instance_eval do
                        #======================== dialog choix cotes et periode
                        profondeur=DynVar.new(1)
                        ok=dialog("Cotes") do
                Severity: Major
                Found in samples/gadget_trading.rb - About 2 hrs to fix

                  Method run has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def run(wspy,wtarget,stempo,str_size) 
                    tempo= (stempo.size>0) ? (stempo.to_f)/1000.0 : nil
                    tr_size=(str_size.size>0) ? str_size.to_i : nil
                    tempo=22 if tr_size && ! tempo
                    raise("missing proxy port number") if wspy[:port].text.size==0 || wspy[:port].text.to_i<=0
                  Severity: Major
                  Found in samples/spygui.rb - About 2 hrs to fix

                    Method test_canvas has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def test_canvas()
                         flow do
                            stack do
                              button("Color") {
                                @color=ask_color()
                    Severity: Minor
                    Found in samples/test.rb - About 2 hrs 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