Showing 7 of 7 total issues
Method page
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def page
req_host = params[:req_host]
req_url = params[:req_url]
subdomain_config = Odania.plugin.get_subdomain_config(req_host)
Method page
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def page
req_host = params[:req_host]
req_url = params[:req_url]
subdomain_config = Odania.plugin.get_subdomain_config(req_host)
- 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 content
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def content
req_host = params[:req_host]
req_url = params[:req_url]
locale = params[:locale]
subdomain_config = Odania.plugin.get_subdomain_config(req_host)
Method initialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize
index_content = {
cacheable: {type: 'boolean'},
content: {type: 'string', index: 'not_analyzed'},
domain: {type: 'string', index: 'not_analyzed'},
Method build_domain_query
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def build_domain_query(domain, req_host)
{
bool: {
should: [
{
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def initialize(template, subdomain_config, domain_query, data={}, extra_partials={})
Method render_direct_page
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def render_direct_page(type, req_host, path, subdomain_config, data)