Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

2213-1 #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

2213-1 #161

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 11, 2018

Номер

2213

Номер задания

1

Ссылка на видео с демо

https://www.youtube.com/watch?v=LnYo0S268tg

Комментарии

Все коаны выполнил, проверил локально, пытаюсь накормить собаку

#
# This method smells of :reek:UtilityFunction
# This method smells of :reek:FeatureEnvy
def triangle(side_a, side_b, side_c)
Copy link
Member

Choose a reason for hiding this comment

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

not sure how this can pass koans if you don't raise triangle_error in this method

attr_reader :values

def roll(count)
@values = (0...count).map { rand(1..6) }
Copy link
Member

Choose a reason for hiding this comment

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

try to initialize array with number and pass a block

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_constants_become_symbols
all_symbols_as_strings = Symbol.all_symbols.map{&:to_s}

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tAMPER

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_method_names_become_symbols
symbols_as_strings = Symbol.all_symbols.map{&:to_s}

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tAMPER

assert_equal 1150, score([1, 1, 1, 5, 1])
end
end
# rubocop:disable Lint/Syntax

Choose a reason for hiding this comment

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

Lint/UnneededCopDisableDirective: Unnecessary disabling of Lint/Syntax.

end

# This class smells of :reek:UncommunicativeModuleName
class AboutScoringProject < Neo::Koan

Choose a reason for hiding this comment

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

Lint/Syntax: class definition in method body

# This method smells of :reek:FeatureEnvy
def triangle(side_a, side_b, side_c)
# WRITE THIS CODE
triangle_error(side_a,side_b,side_c)

Choose a reason for hiding this comment

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

Layout/SpaceAfterComma: Space missing after comma.

# makes some assertions about it.

nil.some_method_nil_doesnt_know_about
rescue Exception => ex

Choose a reason for hiding this comment

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

Lint/RescueException: Avoid rescuing the Exception class. Perhaps you meant to rescue StandardError?

assert_equal 'dos', hash2[:two]
end

# rubocop:disable Metrics/AbcSize

Choose a reason for hiding this comment

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

Lint/UnneededCopDisableDirective: Unnecessary disabling of Metrics/AbcSize.

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_hash_keys
hash = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:FeatureEnvy
def test_hash_is_unordered
hash1 = { one: => 'uno', two: => 'dos' }
hash2 = { two: => 'dos', one: => 'uno' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_hash_is_unordered
hash1 = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

def test_changing_hashes
hash = { one: => 'uno', two: => 'dos' }
hash[:one] = 'eins'
expected = { one: => 'eins', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_changing_hashes
hash = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_accessing_hashes_with_fetch
hash = { one: => 'uno' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_accessing_hashes
hash = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_hash_literals
hash = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

def test_changing_hashes
hash = { one: => 'uno', two: => 'dos' }
hash[:one] = 'eins'
expected = { one: => 'eins', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_changing_hashes
hash = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_accessing_hashes_with_fetch
hash = { one: => 'uno' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_accessing_hashes
hash = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

# This method smells of :reek:TooManyStatements
# This method smells of :reek:FeatureEnvy
def test_hash_literals
hash = { one: => 'uno', two: => 'dos' }

Choose a reason for hiding this comment

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

Lint/Syntax: unexpected token tASSOC

@@ -0,0 +1,231 @@
require File.expand_path(File.dirname(__FILE__) + '/neo')

# rubocop:disable Style/MethodMissingSuper

Choose a reason for hiding this comment

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

Lint/UnneededCopDisableDirective: Unnecessary disabling of Style/MethodMissingSuper (did you mean Style/SingleLineMethods?).

# ------------------------------------------------------------------

class WellBehavedFooCatcher
def method_missing(method_name, *args, &block)

Choose a reason for hiding this comment

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

Style/MethodMissing: When using method_missing, define respond_to_missing? and fall back on super.


class AllMessageCatcher
# This method smells of :reek:UtilityFunction
def method_missing(method_name, *args)

Choose a reason for hiding this comment

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

Style/MethodMissing: When using method_missing, define respond_to_missing? and fall back on super.

require File.expand_path(File.dirname(__FILE__) + '/neo')

# rubocop:disable Style/MissingRespondToMissing
# rubocop:disable Style/MethodMissingSuper

Choose a reason for hiding this comment

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

Lint/UnneededCopDisableDirective: Unnecessary disabling of Style/MethodMissingSuper (did you mean Style/SingleLineMethods?).

@@ -0,0 +1,242 @@
require File.expand_path(File.dirname(__FILE__) + '/neo')

# rubocop:disable Style/MissingRespondToMissing

Choose a reason for hiding this comment

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

Lint/UnneededCopDisableDirective: Unnecessary disabling of Style/MissingRespondToMissing (unknown cop).

end

counts.each do |item, num_found|
if item == 1 && num_found >= 3

Choose a reason for hiding this comment

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

FeatureEnvy: score refers to 'num_found' more than self (maybe move it to another class?). More info.

# ------------------------------------------------------------------
# This method smells of :reek:TooManyStatements
class WellBehavedFooCatcher
def method_missing(method_name, *args, &block)

Choose a reason for hiding this comment

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

Style/MethodMissing: When using method_missing, define respond_to_missing? and fall back on super.

# This method smells of :reek:TooManyStatements
class AllMessageCatcher
# This method smells of :reek:UtilityFunction
def method_missing(method_name, *args)

Choose a reason for hiding this comment

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

Style/MethodMissing: When using method_missing, define respond_to_missing? and fall back on super.

@ghost ghost closed this Jul 11, 2018
@ghost ghost reopened this Jul 11, 2018
@anatoliliotych
Copy link
Member

fix the hound errors.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants