Showing 263 of 263 total issues
File gemstat.rb
has 2731 lines of code (exceeds 250 allowed). Consider refactoring. Open
$authors= %w{wycats markbates jimweirich} # seems the most productives...
$authors1= %w{rdaubarede}
LOCAL_HTDOCS="d:/usr/"
RUBYGEMS="http://rubygems.org"
File draw.rb
has 834 lines of code (exceeds 250 allowed). Consider refactoring. Open
puts "Not terminted !!!!!"
require_relative '../lib/ruiby'
############################### Complete ruiby dsl for vector widget
Method canvas
has 308 lines of code (exceeds 25 allowed). Consider refactoring. Open
def canvas(width,height,option={})
autoslot()
cv=DrawingArea.new()
cv.width_request=width
cv.height_request=height
Identical blocks of code found in 2 locations. Consider refactoring. Open
module Carto
def radians(degrees) (Math::PI * degrees) / 180.0 end
def degrees(radians) (radians * 180.0) / Math::PI end
def tile_nums_2_lonlat(xtile, ytile, zoom)
factor = 2.0 ** (zoom)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 284.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
module Carto
def radians(degrees) (Math::PI * degrees) / 180.0 end
def degrees(radians) (radians * 180.0) / Math::PI end
def tile_nums_2_lonlat(xtile, ytile, zoom)
factor = 2.0 ** (zoom)
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 284.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File gadget_trading.rb
has 465 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'json'
require 'httpclient'
require 'yahoo-finance'
require 'Ruiby' unless Dir.exists?("../lib/ruiby_dsl")
require_relative '../lib/Ruiby.rb' if Dir.exists?("../lib/ruiby_dsl")
File test.rb
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
$time_start=Time.now.to_f*1000
$mlog=[]
def mlog(text)
delta=(Time.now.to_f*1000-$time_start).to_i
$mlog << [delta,text]
Method component
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def component()
stack do
#------------ title + entry
stacki do
flow do
- 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 plot
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot(width,height,curves,config={})
plot=canvas(width,height) do
on_canvas_draw { |w,ctx| w.expose(w,ctx) }
on_canvas_button_press { |w,event| w.track(event)}
end
Method ruiby_require
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def ruiby_require(*gems)
w=nil
gems=gems.map {|g| g.split(/\s+/)}.flatten
gems.each do|gem|
begin
- 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
File canvas.rb
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Ruiby_dsl
# Create a drawing area, for pixel/vectoriel draw
# for interactive actions see test.rb fo little example.
#
Class VCanvas_editable
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class VCanvas_editable < VCanvas
def initialize(win,w,h,options)
super
@current=nil
@select={}
Similar blocks of code found in 2 locations. Consider refactoring. Open
class CacheTiles
DIR="#{Dir.tmpdir}/atiles"
TMPZ="#{DIR}/ZOOM"
TMPZL="#{TMPZ}/LON"
TMP="#{TMPZL}/LAT.jpg"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 191.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
class CacheTiles
DIR="#{Dir.tmpdir}/tiles"
TMPZ="#{DIR}/ZOOM"
TMPZL="#{TMPZ}/LON"
TMP="#{TMPZL}/LAT.jpg"
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 191.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method canvasOld
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def canvasOld(width,height,option={})
puts "*** DEPRECATED: use canvas do end in place of canvasOld ***"
autoslot()
w=DrawingArea.new()
w.width_request=width
- 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 game
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def game()
mat2=@oldmat
MAXC.times do |col| MAXL.times do |li|
poids= 0; n=0
[-1, 0, 1].each { |col_off| [-1, 0, 1].each { |li_off|
- 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 bench
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
def bench(code)
begin
eval( "class Test ; def self.test() #{([code]*100).join(" ; ")} ; end ; end ",$global)
__i=0
istep=100 # number of Test.test() in the while()
Method _radio_buttons
has a Cognitive Complexity of 34 (exceeds 5 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|
- 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
has a Cognitive Complexity of 34 (exceeds 5 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
- 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 game
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def game()
mat2=@oldmat
MAXC.times do |col| MAXL.times do |li|
nb_neighboring= 0
[-1, 0, 1].each { |col_off| [-1, 0, 1].each { |li_off|
- 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"