repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/missing_safe_method_spec.rb | spec/reek/smell_detectors/missing_safe_method_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/missing_safe_method'
RSpec.describe Reek::SmellDetectors::MissingSafeMethod do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo!
end
end
RUBY
expect(src).t... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/too_many_methods_spec.rb | spec/reek/smell_detectors/too_many_methods_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/too_many_methods'
RSpec.describe Reek::SmellDetectors::TooManyMethods do
let(:config) do
{ described_class::MAX_ALLOWED_METHODS_KEY => 3 }
end
it 'reports the right values' do
src = <<-RUBY
class ... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/manual_dispatch_spec.rb | spec/reek/smell_detectors/manual_dispatch_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/too_many_constants'
RSpec.describe Reek::SmellDetectors::ManualDispatch do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo(charlie)
true if charlie.respond_to?(:to_a)
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/instance_variable_assumption_spec.rb | spec/reek/smell_detectors/instance_variable_assumption_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/instance_variable_assumption'
RSpec.describe Reek::SmellDetectors::InstanceVariableAssumption do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo
@charlie
end
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/class_variable_spec.rb | spec/reek/smell_detectors/class_variable_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/class_variable'
RSpec.describe Reek::SmellDetectors::ClassVariable do
it 'reports the right values' do
src = <<-RUBY
class Alfa
@@bravo = 5
end
RUBY
expect(src).to reek_of(:ClassVari... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/too_many_statements_spec.rb | spec/reek/smell_detectors/too_many_statements_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/too_many_statements'
RSpec.describe Reek::SmellDetectors::TooManyStatements do
let(:config) do
{ described_class::MAX_ALLOWED_STATEMENTS_KEY => 2 }
end
it 'reports the right values' do
src = <<-RUBY
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/control_parameter_spec.rb | spec/reek/smell_detectors/control_parameter_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/control_parameter'
RSpec.describe Reek::SmellDetectors::ControlParameter do
it 'reports the right values' do
src = <<-RUBY
def alfa(bravo)
bravo ? true : false
end
RUBY
expect(src).t... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/unused_private_method_spec.rb | spec/reek/smell_detectors/unused_private_method_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/unused_private_method'
RSpec.describe Reek::SmellDetectors::UnusedPrivateMethod do
it 'reports the right values' do
src = <<-RUBY
class Alfa
private
def charlie
end
end
R... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/subclassed_from_core_class_spec.rb | spec/reek/smell_detectors/subclassed_from_core_class_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/subclassed_from_core_class'
RSpec.describe Reek::SmellDetectors::SubclassedFromCoreClass do
it 'reports the right values' do
src = <<-RUBY
class Alfa < Hash
end
RUBY
expect(src).to reek_of(:... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/data_clump_spec.rb | spec/reek/smell_detectors/data_clump_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/data_clump'
RSpec.describe Reek::SmellDetectors::DataClump do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo (echo, foxtrot); end
def charlie(echo, foxtrot); end
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/boolean_parameter_spec.rb | spec/reek/smell_detectors/boolean_parameter_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/boolean_parameter'
RSpec.describe Reek::SmellDetectors::BooleanParameter do
it 'reports the right values' do
src = <<-RUBY
def alfa(bravo = true)
end
RUBY
expect(src).to reek_of(:BooleanPara... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/feature_envy_spec.rb | spec/reek/smell_detectors/feature_envy_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/feature_envy'
RSpec.describe Reek::SmellDetectors::FeatureEnvy do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo(charlie)
(charlie.delta - charlie.echo) * foxtrot
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/uncommunicative_module_name_spec.rb | spec/reek/smell_detectors/uncommunicative_module_name_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/uncommunicative_module_name'
RSpec.describe Reek::SmellDetectors::UncommunicativeModuleName do
it 'reports the right values' do
src = <<-RUBY
class K
end
RUBY
expect(src).to reek_of(:Uncommu... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/base_detector_spec.rb | spec/reek/smell_detectors/base_detector_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/base_detector'
require_lib 'reek/smell_detectors/duplicate_method_call'
RSpec.describe Reek::SmellDetectors::BaseDetector do
describe '.todo_configuration_for' do
it 'returns exclusion configuration for the give... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/repeated_conditional_spec.rb | spec/reek/smell_detectors/repeated_conditional_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/repeated_conditional'
RSpec.describe Reek::SmellDetectors::RepeatedConditional do
it 'reports the right values' do
src = <<-RUBY
class Alfa
attr_accessor :bravo
def charlie
puts ... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/attribute_spec.rb | spec/reek/smell_detectors/attribute_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/attribute'
RSpec.describe Reek::SmellDetectors::Attribute do
it 'reports the right values' do
src = <<-RUBY
class Alfa
attr_writer :bravo
end
RUBY
expect(src).to reek_of(:Attribute,
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/duplicate_method_call_spec.rb | spec/reek/smell_detectors/duplicate_method_call_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/duplicate_method_call'
RSpec.describe Reek::SmellDetectors::DuplicateMethodCall do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo(charlie)
charlie.delta
cha... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/long_yield_list_spec.rb | spec/reek/smell_detectors/long_yield_list_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/long_yield_list'
RSpec.describe Reek::SmellDetectors::LongYieldList do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo(charlie, delta, echo, foxtrot)
yield charlie, de... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/uncommunicative_method_name_spec.rb | spec/reek/smell_detectors/uncommunicative_method_name_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/uncommunicative_method_name'
RSpec.describe Reek::SmellDetectors::UncommunicativeMethodName do
it 'reports the right values' do
src = <<-RUBY
def m; end
RUBY
expect(src).to reek_of(:Uncommunicativ... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/utility_function_spec.rb | spec/reek/smell_detectors/utility_function_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/utility_function'
RSpec.describe Reek::SmellDetectors::UtilityFunction do
it 'reports the right values' do
src = <<-RUBY
def alfa(bravo)
bravo.charlie.delta
end
RUBY
expect(src).to r... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/nil_check_spec.rb | spec/reek/smell_detectors/nil_check_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/nil_check'
RSpec.describe Reek::SmellDetectors::NilCheck do
it 'reports the right values' do
src = <<-RUBY
def alfa(bravo)
bravo.nil?
end
RUBY
expect(src).to reek_of(:NilCheck,
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/long_parameter_list_spec.rb | spec/reek/smell_detectors/long_parameter_list_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/long_parameter_list'
RSpec.describe Reek::SmellDetectors::LongParameterList do
it 'reports the right values' do
src = <<-RUBY
class Alfa
def bravo(charlie, delta, echo, foxtrot)
end
e... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/unused_parameters_spec.rb | spec/reek/smell_detectors/unused_parameters_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/unused_parameters'
RSpec.describe Reek::SmellDetectors::UnusedParameters do
it 'reports the right values' do
src = <<-RUBY
def alfa(bravo)
end
RUBY
expect(src).to reek_of(:UnusedParameters,
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/too_many_instance_variables_spec.rb | spec/reek/smell_detectors/too_many_instance_variables_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/too_many_instance_variables'
RSpec.describe Reek::SmellDetectors::TooManyInstanceVariables do
let(:config) do
{ described_class::MAX_ALLOWED_IVARS_KEY => 2 }
end
it 'reports the right values' do
src = <... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/smell_detectors/module_initialize_spec.rb | spec/reek/smell_detectors/module_initialize_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/smell_detectors/module_initialize'
RSpec.describe Reek::SmellDetectors::ModuleInitialize do
it 'reports the right values' do
src = <<-RUBY
module Alfa
def initialize; end
end
RUBY
expect(src).to ree... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/cli/silencer_spec.rb | spec/reek/cli/silencer_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/cli/silencer'
RSpec.describe Reek::CLI::Silencer do
describe '.silently' do
it 'blocks output from the block on $stdout' do
expect { described_class.silently { puts 'Hi!' } }.not_to output.to_stdout
end
it 'block... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/cli/application_spec.rb | spec/reek/cli/application_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/cli/application'
RSpec.describe Reek::CLI::Application do
describe '#initialize' do
it 'exits with default error code on invalid options' do
call = lambda do
Reek::CLI::Silencer.silently do
described_cla... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/cli/options_spec.rb | spec/reek/cli/options_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/cli/options'
RSpec.describe Reek::CLI::Options do
let(:options) { described_class.new }
describe '#initialize' do
it 'sets a valid default value for report_format' do
expect(options.report_format).to eq :text
end
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/cli/command/todo_list_command_spec.rb | spec/reek/cli/command/todo_list_command_spec.rb | # frozen_string_literal: true
require_relative '../../../spec_helper'
require_lib 'reek/cli/command/todo_list_command'
require_lib 'reek/cli/options'
require_lib 'reek/configuration/app_configuration'
RSpec.describe Reek::CLI::Command::TodoListCommand do
let(:existing_configuration) do
<<~YAML
---
d... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/cli/command/report_command_spec.rb | spec/reek/cli/command/report_command_spec.rb | # frozen_string_literal: true
require_relative '../../../spec_helper'
require_lib 'reek/cli/command/report_command'
require_lib 'reek/cli/options'
RSpec.describe Reek::CLI::Command::ReportCommand do
describe '#execute' do
let(:options) { Reek::CLI::Options.new [] }
let(:configuration) { instance_double Ree... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/ast/sexp_extensions_spec.rb | spec/reek/ast/sexp_extensions_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/ast/sexp_extensions'
RSpec.describe Reek::AST::SexpExtensions::DefNode do
context 'with no parameters' do
let(:node) { sexp(:def, :hello, sexp(:args)) }
it 'has no arg names' do
expect(node.arg_names).to eq []
en... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/ast/reference_collector_spec.rb | spec/reek/ast/reference_collector_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/ast/reference_collector'
RSpec.describe Reek::AST::ReferenceCollector do
describe '#num_refs_to_self' do
def refs_to_self(src)
syntax_tree = Reek::Source::SourceCode.from(src).syntax_tree
described_class.new(syntax_... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/ast/object_refs_spec.rb | spec/reek/ast/object_refs_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/ast/object_refs'
RSpec.describe Reek::AST::ObjectRefs do
let(:refs) { described_class.new }
context 'when empty' do
it 'reports no refs to self' do
expect(refs.references_to(:self)).to be_empty
end
end
context... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/ast/node_spec.rb | spec/reek/ast/node_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/ast/node'
RSpec.describe Reek::AST::Node do
describe '#each_node' do
context 'with an empty module' do
let(:ast) do
src = 'module Emptiness; end'
Reek::Source::SourceCode.from(src).syntax_tree
end
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/context/root_context_spec.rb | spec/reek/context/root_context_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/context/root_context'
RSpec.describe Reek::Context::RootContext do
describe '#full_name' do
it 'reports full context' do
ast = Reek::Source::SourceCode.from('foo = 1').syntax_tree
root = described_class.new(ast)
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/context/method_context_spec.rb | spec/reek/context/method_context_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/context/method_context'
RSpec.describe Reek::Context::MethodContext do
let(:method_context) { described_class.new(exp, nil) }
describe '#matches?' do
let(:exp) { instance_double(Reek::AST::SexpExtensions::ModuleNode).as_null... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/context/statement_counter_spec.rb | spec/reek/context/statement_counter_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/context/statement_counter'
RSpec.describe Reek::Context::StatementCounter do
let(:counter) { described_class.new }
describe '#increase_by' do
it 'does not increase if passed a falsy value' do
counter.increase_by(nil)
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/context/module_context_spec.rb | spec/reek/context/module_context_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/context/module_context'
require_lib 'reek/context/root_context'
RSpec.describe Reek::Context::ModuleContext do
it 'reports module name for smell in method' do
expect('
module Fred
def simple(x) x + 1; end
en... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/context/ghost_context_spec.rb | spec/reek/context/ghost_context_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/context/code_context'
require_lib 'reek/context/ghost_context'
RSpec.describe Reek::Context::GhostContext do
let(:exp) { instance_double(Reek::AST::Node) }
let(:parent) { Reek::Context::CodeContext.new(exp) }
describe '#regist... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/spec/reek/context/code_context_spec.rb | spec/reek/context/code_context_spec.rb | # frozen_string_literal: true
require_relative '../../spec_helper'
require_lib 'reek/context/method_context'
require_lib 'reek/context/module_context'
RSpec.describe Reek::Context::CodeContext do
describe '#full_name' do
let(:ctx) { described_class.new(exp) }
let(:exp) { instance_double(Reek::AS... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/docs/yard_plugin.rb | docs/yard_plugin.rb | # frozen_string_literal: true
require 'yard'
# Template helper to modify processing of links in HTML generated from our
# markdown files.
module LocalLinkHelper
# Rewrites links to (assumed local) markdown files so they're processed as
# {file: } directives.
def resolve_links(text)
text = text.gsub(%r{<a hr... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/docs/templates/default/docstring/setup.rb | docs/templates/default/docstring/setup.rb | # frozen_string_literal: true
def init
super
return unless show_api_marker_section?
if sections.first
sections.first.place(:api_marker).before(:private)
else
sections :index, [:api_marker]
end
end
def api_marker
return if object.type == :root
erb(:private) unless ['public', 'private'].include?... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek.rb | lib/reek.rb | # frozen_string_literal: true
#
# Reek's core functionality
#
require_relative 'reek/version'
require_relative 'reek/examiner'
require_relative 'reek/report'
module Reek
DEFAULT_SMELL_CONFIGURATION = File.join(__dir__, '../docs/defaults.reek.yml').freeze
DEFAULT_CONFIGURATION_FILE_NAME = '.reek.yml'
DETECTORS_K... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report.rb | lib/reek/report.rb | # frozen_string_literal: true
require_relative 'report/github_report'
require_relative 'report/html_report'
require_relative 'report/json_report'
require_relative 'report/text_report'
require_relative 'report/xml_report'
require_relative 'report/yaml_report'
require_relative 'report/heading_formatter'
require_relativ... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/examiner.rb | lib/reek/examiner.rb | # frozen_string_literal: true
require_relative 'context_builder'
require_relative 'detector_repository'
require_relative 'errors/incomprehensible_source_error'
require_relative 'errors/encoding_error'
require_relative 'errors/syntax_error'
require_relative 'source/source_code'
module Reek
#
# Applies all availabl... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/smell_configuration.rb | lib/reek/smell_configuration.rb | # frozen_string_literal: true
module Reek
#
# Represents a single set of configuration options for a smell detector
#
class SmellConfiguration
# The name of the config field that specifies whether a smell is
# enabled. Set to +true+ or +false+.
ENABLED_KEY = 'enabled'
# The name of the config ... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/context_builder.rb | lib/reek/context_builder.rb | # frozen_string_literal: true
require_relative 'context/attribute_context'
require_relative 'context/class_context'
require_relative 'context/ghost_context'
require_relative 'context/method_context'
require_relative 'context/module_context'
require_relative 'context/refinement_context'
require_relative 'context/root_c... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/logging_error_handler.rb | lib/reek/logging_error_handler.rb | # frozen_string_literal: true
require_relative 'errors/base_error'
module Reek
# Handles errors by logging to stderr
class LoggingErrorHandler
def handle(exception)
case exception
when Errors::BaseError
warn exception.long_message
else
warn exception.message
end
t... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/code_comment.rb | lib/reek/code_comment.rb | # frozen_string_literal: true
require 'yaml'
require_relative 'smell_detectors/base_detector'
require_relative 'errors/bad_detector_in_comment_error'
require_relative 'errors/bad_detector_configuration_key_in_comment_error'
require_relative 'errors/garbage_detector_configuration_in_comment_error'
require_relative 'er... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/smell_warning.rb | lib/reek/smell_warning.rb | # frozen_string_literal: true
require 'forwardable'
require_relative 'documentation_link'
module Reek
#
# Reports a warning that a smell has been found.
#
# @public
#
# @quality :reek:TooManyInstanceVariables { max_instance_variables: 6 }
class SmellWarning
include Comparable
extend Forwardable
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/version.rb | lib/reek/version.rb | # frozen_string_literal: true
# @public
module Reek
#
# This module holds the Reek version information
#
# @public
module Version
# @public
STRING = '6.5.0'
end
end
| ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/tree_dresser.rb | lib/reek/tree_dresser.rb | # frozen_string_literal: true
require_relative 'ast/ast_node_class_map'
module Reek
#
# Adorns an abstract syntax tree with mix-in modules to make accessing
# the tree more understandable and less implementation-dependent.
#
class TreeDresser
def initialize(klass_map: AST::ASTNodeClassMap.new)
@kl... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/spec.rb | lib/reek/spec.rb | # frozen_string_literal: true
require_relative 'spec/should_reek'
require_relative 'spec/should_reek_of'
require_relative 'spec/should_reek_only_of'
module Reek
#
# Provides matchers for RSpec, making it easy to check code quality.
#
# If you require this module somewhere within your spec (or in your spec_hel... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/code_climate.rb | lib/reek/code_climate.rb | # frozen_string_literal: true
require_relative 'code_climate/code_climate_fingerprint'
require_relative 'code_climate/code_climate_formatter'
require_relative 'code_climate/code_climate_report'
| ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/smell_detectors.rb | lib/reek/smell_detectors.rb | # frozen_string_literal: true
require_relative 'smell_detectors/attribute'
require_relative 'smell_detectors/boolean_parameter'
require_relative 'smell_detectors/class_variable'
require_relative 'smell_detectors/control_parameter'
require_relative 'smell_detectors/data_clump'
require_relative 'smell_detectors/duplicat... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/documentation_link.rb | lib/reek/documentation_link.rb | # frozen_string_literal: true
module Reek
# Generate versioned links to our documentation
module DocumentationLink
HELP_LINK_TEMPLATE = 'https://github.com/troessner/reek/blob/v%<version>s/docs/%<item>s.md'
module_function
# Build link to the documentation about the given subject for the current
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/detector_repository.rb | lib/reek/detector_repository.rb | # frozen_string_literal: true
require_relative 'smell_detectors'
require_relative 'smell_detectors/base_detector'
require_relative 'configuration/app_configuration'
module Reek
#
# Contains all the existing smell detectors and exposes operations on them.
#
class DetectorRepository
# @return [Array<Reek::S... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/base_error.rb | lib/reek/errors/base_error.rb | # frozen_string_literal: true
module Reek
module Errors
# Base class for all runtime Reek errors
class BaseError < ::RuntimeError
def long_message
message
end
end
end
end
| ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/incomprehensible_source_error.rb | lib/reek/errors/incomprehensible_source_error.rb | # frozen_string_literal: true
require_relative 'base_error'
module Reek
module Errors
# Gets raised when Reek is unable to process the source
class IncomprehensibleSourceError < BaseError
TEMPLATE = 'Source %<source>s cannot be processed by Reek.'
LONG_TEMPLATE = <<-MESSAGE
!!!
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/syntax_error.rb | lib/reek/errors/syntax_error.rb | # frozen_string_literal: true
require_relative 'base_error'
module Reek
module Errors
# Gets raised when Reek is unable to process the source due to a SyntaxError
class SyntaxError < BaseError
TEMPLATE = "Source '%<source>s' cannot be processed by Reek due to a syntax error in the source file."
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/config_file_error.rb | lib/reek/errors/config_file_error.rb | # frozen_string_literal: true
require_relative 'base_error'
module Reek
module Errors
# Gets raised when Reek is unable to process the source due to bad config file
class ConfigFileError < BaseError
end
end
end
| ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb | lib/reek/errors/bad_detector_configuration_key_in_comment_error.rb | # frozen_string_literal: true
require_relative 'base_error'
require_relative '../documentation_link'
module Reek
module Errors
# Gets raised when trying to configure a detector with an option
# which is unknown to it.
class BadDetectorConfigurationKeyInCommentError < BaseError
UNKNOWN_SMELL_DETECT... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/garbage_detector_configuration_in_comment_error.rb | lib/reek/errors/garbage_detector_configuration_in_comment_error.rb | # frozen_string_literal: true
require_relative 'base_error'
require_relative '../documentation_link'
module Reek
module Errors
# Gets raised when trying to use a configuration for a detector
# that can't be parsed into a hash.
class GarbageDetectorConfigurationInCommentError < BaseError
BAD_DETECT... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/bad_detector_in_comment_error.rb | lib/reek/errors/bad_detector_in_comment_error.rb | # frozen_string_literal: true
require_relative 'base_error'
require_relative '../documentation_link'
module Reek
module Errors
# Gets raised when trying to configure a detector which is unknown to us.
# This might happen for multiple reasons. The users might have a typo in
# his comment or he might use ... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/encoding_error.rb | lib/reek/errors/encoding_error.rb | # frozen_string_literal: true
require_relative 'base_error'
module Reek
module Errors
# Gets raised when Reek is unable to process the source due to an EncodingError
class EncodingError < BaseError
TEMPLATE = "Source '%<source>s' cannot be processed by Reek due to an encoding error in the source file.... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/errors/legacy_comment_separator_error.rb | lib/reek/errors/legacy_comment_separator_error.rb | # frozen_string_literal: true
require_relative 'base_error'
module Reek
module Errors
# Gets raised for old-style comment configuration format.
class LegacyCommentSeparatorError < BaseError
MESSAGE = <<-MESSAGE.freeze
Error: You are using the legacy configuration format (including three
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/configuration_validator.rb | lib/reek/configuration/configuration_validator.rb | # frozen_string_literal: true
require_relative '../errors/config_file_error'
module Reek
module Configuration
#
# Configuration validator module.
#
module ConfigurationValidator
private
# @quality :reek:UtilityFunction
def smell_type?(key)
Reek::SmellDetectors.const_define... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/schema_validator.rb | lib/reek/configuration/schema_validator.rb | # frozen_string_literal: true
require_relative '../errors/config_file_error'
require_relative 'schema'
module Reek
module Configuration
#
# Schema validator module.
#
class SchemaValidator
def initialize(configuration)
@configuration = configuration
config_directories = configu... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/configuration_converter.rb | lib/reek/configuration/configuration_converter.rb | # frozen_string_literal: true
require_relative 'configuration_validator'
module Reek
module Configuration
# Responsible for converting marked strings coming from the outside world
# into proper regexes.
class ConfigurationConverter
REGEXABLE_ATTRIBUTES = %w(accept reject exclude).freeze
incl... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/rake_task_converter.rb | lib/reek/configuration/rake_task_converter.rb | # frozen_string_literal: true
module Reek
module Configuration
# Responsible for converting configuration values coming from the outside world
# to whatever we want to use internally.
module RakeTaskConverter
class << self
REGEXABLE_ATTRIBUTES = %w(accept reject exclude).freeze
# C... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/configuration_file_finder.rb | lib/reek/configuration/configuration_file_finder.rb | # frozen_string_literal: true
require 'pathname'
require_relative 'configuration_converter'
require_relative 'schema_validator'
require_relative '../errors/config_file_error'
module Reek
module Configuration
#
# ConfigurationFileFinder is responsible for finding Reek's configuration.
#
# There are 3... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/app_configuration.rb | lib/reek/configuration/app_configuration.rb | # frozen_string_literal: true
require 'pathname'
require_relative 'configuration_file_finder'
require_relative 'configuration_validator'
require_relative 'default_directive'
require_relative 'directory_directives'
require_relative 'excluded_paths'
module Reek
module Configuration
#
# Reek's application conf... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/excluded_paths.rb | lib/reek/configuration/excluded_paths.rb | # frozen_string_literal: true
require_relative 'configuration_validator'
require_relative '../errors/config_file_error'
module Reek
module Configuration
#
# Array extension for excluded paths.
#
module ExcludedPaths
include ConfigurationValidator
# @param paths [String]
# @return ... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/default_directive.rb | lib/reek/configuration/default_directive.rb | # frozen_string_literal: true
require_relative 'configuration_validator'
module Reek
module Configuration
#
# Hash extension for the default directive.
#
module DefaultDirective
include ConfigurationValidator
# Adds the configuration for detectors as default directive.
#
# @... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/schema.rb | lib/reek/configuration/schema.rb | # frozen_string_literal: true
require 'dry/schema'
module Reek
module Configuration
#
# Configuration schema constants.
#
class Schema
# Enable the :info extension so we can introspect
# your keys and types
Dry::Schema.load_extensions(:info)
# rubocop:disable Metrics/BlockLe... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/configuration/directory_directives.rb | lib/reek/configuration/directory_directives.rb | # frozen_string_literal: true
require_relative 'configuration_validator'
module Reek
module Configuration
#
# Hash extension for directory directives.
#
module DirectoryDirectives
include ConfigurationValidator
# Returns the directive for a given source.
#
# @param source_vi... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/source/source_code.rb | lib/reek/source/source_code.rb | # frozen_string_literal: true
require_relative '../cli/silencer'
# Silence Parser's warnings about Ruby micro version differences
Reek::CLI::Silencer.silently { require 'parser/current' }
require_relative '../tree_dresser'
require_relative '../ast/node'
require_relative '../ast/builder'
# Opt in to new way of represe... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/source/source_locator.rb | lib/reek/source/source_locator.rb | # frozen_string_literal: true
require 'find'
require 'pathname'
module Reek
module Source
#
# Finds Ruby source files in a filesystem.
#
class SourceLocator
# Initialize with the paths we want to search.
#
# paths - a list of paths as Strings
def initialize(paths, configurati... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/code_climate/code_climate_fingerprint.rb | lib/reek/code_climate/code_climate_fingerprint.rb | # frozen_string_literal: true
require 'digest'
module Reek
module CodeClimate
# Generates a string to uniquely identify a smell
class CodeClimateFingerprint
NON_IDENTIFYING_PARAMETERS = [:count, :depth].freeze
def initialize(warning)
@warning = warning
end
def compute
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/code_climate/code_climate_formatter.rb | lib/reek/code_climate/code_climate_formatter.rb | # frozen_string_literal: true
require 'codeclimate_engine'
require_relative 'code_climate_configuration'
module Reek
module CodeClimate
# Generates a hash in the structure specified by the Code Climate engine spec
class CodeClimateFormatter
def initialize(warning)
@warning = warning
end
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/code_climate/code_climate_report.rb | lib/reek/code_climate/code_climate_report.rb | # frozen_string_literal: true
require_relative '../report/base_report'
require_relative 'code_climate_formatter'
module Reek
module CodeClimate
#
# Displays a list of smells in Code Climate engine format
# (https://github.com/codeclimate/spec/blob/master/SPEC.md)
# JSON with empty array for 0 smells... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/code_climate/code_climate_configuration.rb | lib/reek/code_climate/code_climate_configuration.rb | # frozen_string_literal: true
module Reek
module CodeClimate
# loads the smell type metadata to present in Code Climate
module CodeClimateConfiguration
def self.load
config_file = File.expand_path('code_climate_configuration.yml', __dir__)
YAML.load_file config_file
end
end
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/spec/should_reek_of.rb | lib/reek/spec/should_reek_of.rb | # frozen_string_literal: true
require_relative '../examiner'
require_relative 'smell_matcher'
require_relative '../configuration/app_configuration'
module Reek
module Spec
#
# An rspec matcher that matches when the +actual+ has the specified
# code smell.
#
class ShouldReekOf
include RSpec... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/spec/should_reek.rb | lib/reek/spec/should_reek.rb | # frozen_string_literal: true
require_relative '../examiner'
require_relative '../report/simple_warning_formatter'
module Reek
module Spec
#
# An rspec matcher that matches when the +actual+ has code smells.
#
class ShouldReek
def initialize(configuration: Configuration::AppConfiguration.defau... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/spec/should_reek_only_of.rb | lib/reek/spec/should_reek_only_of.rb | # frozen_string_literal: true
require_relative '../examiner'
require_relative '../report/simple_warning_formatter'
require_relative 'should_reek_of'
require_relative 'smell_matcher'
module Reek
module Spec
#
# An rspec matcher that matches when the +actual+ has the specified
# code smell and no others.
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/spec/smell_matcher.rb | lib/reek/spec/smell_matcher.rb | # frozen_string_literal: true
module Reek
module Spec
#
# Matches a +SmellWarning+ object agains a smell type and hash of attributes.
#
class SmellMatcher
attr_reader :smell_warning
COMPARABLE_ATTRIBUTES = [:message, :lines, :context, :source].freeze
def initialize(smell_warning)
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/base_report.rb | lib/reek/report/base_report.rb | # frozen_string_literal: true
require 'json'
require 'pathname'
require 'rainbow'
module Reek
# @public
module Report
#
# A report that contains the smells and smell counts following source code analysis.
#
# @abstract Subclass and override {#show} to create a concrete report class.
#
# @p... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/json_report.rb | lib/reek/report/json_report.rb | # frozen_string_literal: true
require_relative 'base_report'
module Reek
module Report
#
# Displays a list of smells in JSON format
# JSON with empty array for 0 smells
#
# @public
#
class JSONReport < BaseReport
def show(out = $stdout)
out.print ::JSON.generate smells.map(... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/documentation_link_warning_formatter.rb | lib/reek/report/documentation_link_warning_formatter.rb | # frozen_string_literal: true
require_relative 'simple_warning_formatter'
module Reek
module Report
#
# Formatter that adds a link to the docs to the basic message from
# SimpleWarningFormatter.
#
class DocumentationLinkWarningFormatter < SimpleWarningFormatter
def format(warning)
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/html_report.rb | lib/reek/report/html_report.rb | # frozen_string_literal: true
require_relative 'base_report'
module Reek
module Report
#
# Saves the report as a HTML file
#
# @public
#
class HTMLReport < BaseReport
require 'erb'
# @public
def show
template_path = Pathname.new("#{__dir__}/html_report/html_report.... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/heading_formatter.rb | lib/reek/report/heading_formatter.rb | # frozen_string_literal: true
module Reek
module Report
#
# Base class for heading formatters.
# Is responsible for formatting the heading emitted for each examiner
#
# @abstract Override {#show_header?} to implement a heading formatter.
class HeadingFormatterBase
# @quality :reek:Utili... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/yaml_report.rb | lib/reek/report/yaml_report.rb | # frozen_string_literal: true
require_relative 'base_report'
module Reek
module Report
#
# Displays a list of smells in YAML format
# YAML with empty array for 0 smells
#
# @public
#
class YAMLReport < BaseReport
def show(out = $stdout)
out.print smells.map(&:yaml_hash).to_... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/location_formatter.rb | lib/reek/report/location_formatter.rb | # frozen_string_literal: true
module Reek
module Report
#
# Formats the location of a warning as an empty string.
#
module BlankLocationFormatter
module_function
def format(_warning)
''
end
end
#
# Formats the location of a warning as an array of line numbers.
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/xml_report.rb | lib/reek/report/xml_report.rb | # frozen_string_literal: true
require_relative 'base_report'
module Reek
module Report
#
# Generates a list of smells in XML format
#
# @public
#
class XMLReport < BaseReport
require 'rexml/document'
# @public
def show
document.write output: $stdout, indent: 2
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/text_report.rb | lib/reek/report/text_report.rb | # frozen_string_literal: true
require_relative 'base_report'
module Reek
module Report
#
# Generates a sorted, text summary of smells in examiners
#
# @public
#
class TextReport < BaseReport
# @public
def initialize(**args)
super
print progress_formatter.header
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/github_report.rb | lib/reek/report/github_report.rb | # frozen_string_literal: true
require_relative 'base_report'
module Reek
module Report
#
# Displays smells as GitHub Workflow commands.
#
# @public
#
class GithubReport < BaseReport
def show(out = $stdout)
out.print(workflow_commands.join)
end
private
def wo... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/progress_formatter.rb | lib/reek/report/progress_formatter.rb | # frozen_string_literal: true
module Reek
module Report
module ProgressFormatter
#
# Base class for progress formatters.
# Is responsible for formatting the progress emitted for each examiner
#
# @abstract Override {#header, #progress, #footer} to implement a progress formatter.
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/report/simple_warning_formatter.rb | lib/reek/report/simple_warning_formatter.rb | # frozen_string_literal: true
module Reek
module Report
#
# Basic formatter that just shows a simple message for each warning,
# prepended with the result of the passed-in location formatter.
#
class SimpleWarningFormatter
def initialize(location_formatter: BlankLocationFormatter)
@... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/rake/task.rb | lib/reek/rake/task.rb | # frozen_string_literal: true
require 'rake'
require 'rake/tasklib'
require 'pathname'
require 'English'
module Reek
#
# Defines a task library for running Reek.
#
# @public
module Rake
# A Rake task that runs Reek on a set of source files.
#
# Example:
#
# require 'reek/rake/task'
... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
troessner/reek | https://github.com/troessner/reek/blob/cf216cc2a6d709a840d74a7f54ebe5ae1a98699b/lib/reek/smell_detectors/instance_variable_assumption.rb | lib/reek/smell_detectors/instance_variable_assumption.rb | # frozen_string_literal: true
require_relative 'base_detector'
module Reek
module SmellDetectors
#
# The +InstanceVariableAssumption+ class is responsible for
# detecting directly access of instance variables in a class
# that does not define them in its initialize method.
#
class InstanceVa... | ruby | MIT | cf216cc2a6d709a840d74a7f54ebe5ae1a98699b | 2026-01-04T15:47:06.659122Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.