class RuboCop::Cop::Metrics::ModuleLength


end # 6 points
)
2
1,
foo( # +1
HEREDOC
content.
Heredoc
MSG = <<~HEREDOC # +1
}
key: ‘value’
HASH = { # +3
]
2
1,
ARRAY = [ # +1
module M
@example CountAsOne: [‘array’, ‘heredoc’, ‘method_call’]
will be counted as one line regardless of its actual size.
Available are: ‘array’, ‘hash’, ‘heredoc’, and ‘method_call’. Each construct
You can set constructs you want to fold with ‘CountAsOne`.
The maximum allowed length is configurable.
Comment lines can optionally be ignored.
Checks if the length of a module exceeds some maximum value.

def message(length, max_length)

def message(length, max_length)
  format('Module has too many lines. [%<length>d/%<max>d]', length: length, max: max_length)
end

def on_casgn(node)

def on_casgn(node)
  module_definition?(node) { check_code_length(node) }
end

def on_module(node)

def on_module(node)
  check_code_length(node)
end