Skip to content

Scenario D: threshold - #4

Open
etagwerker wants to merge 1 commit into
mainfrom
threshold/drop
Open

etagwerker wants to merge 1 commit into
mainfrom
threshold/drop

Conversation

@etagwerker

Copy link
Copy Markdown
Member

Scenario D

Comment thread lib/order.rb
end
end

def total_a(items)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: DuplicateCode (new)

Similar code found in 2 nodes

Comment thread lib/order.rb
def process(order, user, flag)
if order
if user
if flag

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: ControlParameter (new)

Order#process is controlled by argument 'flag'

Comment thread lib/order.rb
@@ -0,0 +1,26 @@
class Order
def process(order, user, flag)
if order

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: ControlParameter (new)

Order#process is controlled by argument 'order'

Comment thread lib/order.rb
class Order
def process(order, user, flag)
if order
if user

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: ControlParameter (new)

Order#process is controlled by argument 'user'

Comment thread lib/order.rb
@@ -0,0 +1,26 @@
class Order

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: IrresponsibleModule (new)

Order has no descriptive comment

Comment thread lib/order.rb
@@ -0,0 +1,26 @@
class Order
def process(order, user, flag)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: TooManyStatements (new)

Order#process has approx 11 statements

Comment thread lib/order.rb

def total_a(items)
sum = 0
items.each { |i| sum += i.price * i.quantity if i.active? }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: UncommunicativeVariableName (new)

Order#total_a has the variable name 'i'

Comment thread lib/order.rb

def total_b(items)
sum = 0
items.each { |i| sum += i.price * i.quantity if i.active? }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: UncommunicativeVariableName (new)

Order#total_b has the variable name 'i'

Comment thread lib/order.rb
end
end

def total_a(items)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: UtilityFunction (new)

Order#total_a doesn't depend on instance state (maybe move it to another class?)

Comment thread lib/order.rb
sum
end

def total_b(items)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RubyCritic: UtilityFunction (new)

Order#total_b doesn't depend on instance state (maybe move it to another class?)

@github-actions

Copy link
Copy Markdown

RubyCritic report

Base Head Change
98.87 95.55 -3.32

10 new or worsened smells in this PR.

Score dropped by more than the threshold (0).

Workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant