Showing 2 of 2 total issues
File wysithtml5-parser-rules.js
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var wysihtml5ParserRules = {
/**
* CSS Class white-list
* Following CSS classes won't be removed when parsed by the wysihtml5 HTML parser
*/
Method resource_names
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def resource_names
routes_hash.map do |route|
next unless route && route[:controller] && route[:path_spec]
name = route[:controller].match(/brightcontent\/(.+)/)[1]
if route[:action] == "index" && route[:path_spec].start_with?('/' + name)
- 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"