Showing 13 of 15 total issues
Function fromText
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
static fromText (text) {
let blocking = true
if (text.indexOf('@@') === 0) {
blocking = false
- 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
Function calcDomains
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
calcDomains () {
if (this.domainSource) {
this.domains = new Map()
let domains = this.domainSource.split(this.domainSeparator)
if (domains.length === 1 && domains[0][0] !== '~') {
- 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
Function onBeforeRequest
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onBeforeRequest (details) {
let url = details.url.toLowerCase()
let tabId = details.tabId
let type = details.type
Function fromText
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
static fromText (text) {
let blocking = true
if (text.indexOf('@@') === 0) {
blocking = false
Function onBeforeRequest
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function onBeforeRequest (details) {
let url = details.url.toLowerCase()
let tabId = details.tabId
let type = details.type
- 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
Function matchFilter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
matchFilter (location, contentType, docDomain) {
let keywords = location.toLowerCase().match(/[a-z0-9%]{3,}/g) || []
keywords.unshift('')
let map = this.filterByKeyword
- 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
Function addRemote
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
addRemote (name, url) {
return new Promise((resolve, reject) => {
storage.get(url, (info) => {
if (info[url]) {
this.add(url, info[url].content)
Function findKeyword
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
findKeyword (filter) {
let text = filter.regexpSrc
let defaultResult = ''
if (text.length > 2 && text.startsWith('/') && text.endsWith('/')) {
Function onBeforeSendHeaders
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function onBeforeSendHeaders (details) {
let url = details.url.toLowerCase()
let type = details.type
if (type === 'main_frame') {
- 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
Function isActiveOnDomain
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
isActiveOnDomain (docDomain = '') {
if (this.domainSource) this.calcDomains()
if (!this.domains) return true
docDomain = docDomain.toUpperCase()
let nextDot
- 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
Function match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
match (url, type, documentHost) {
if (this.isInWhitelist(documentHost)) return
let ret = false
for (const blocker of this.blockers.values()) {
const code = blocker.matchStatus(url, type, documentHost)
- 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
Function fromText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
fromText (text = '') {
text = text.trim()
if (!text || text.startsWith('!') || text.includes('#@#')) return
if (/^\[Adblock Plus/i.test(text)) return
- 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
Function selectors
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
* selectors (domain) {
const hotSelectors = this._getSelectorsInHotfilters(domain)
if (hotSelectors.length) {
yield hotSelectors
}
- 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"