Showing 32 of 702 total issues
File fetching_test.py
has 641 lines of code (exceeds 250 allowed). Consider refactoring. Open
# flake8: noqa
import pytest
from urllib.parse import urlparse
from .fetching import extractor
Function exports
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (options) {
var entry = {
'main': ['./beavy/jsbeavy/main.jsx']
}
var loaders = {
Function exports
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (options) {
var entry = {
'main': ['./beavy/jsbeavy/main.jsx']
}
var loaders = {
- 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 _matches
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def _matches(data, **kwargs):
for key, match in kwargs.items():
try:
given_value = data[key]
except KeyError:
- 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 fallbackRender
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def fallbackRender(template, key=None):
def wrapper(fn):
@wraps(fn)
def decorated_view(*args, **kwargs):
- 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 after_scenario
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def after_scenario(context, scenario):
if getattr(context, "browser", None):
has_warnings = False
for entry in context.browser.driver.get_log('browser'):
- 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 format_jsonapi_result
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function format_jsonapi_result (input, key) {
const entitiesMap = {}
const result = {}
const output = { entities: entitiesMap }
const addToMap = (x) => {
- 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 format_jsonapi_result
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function format_jsonapi_result (input, key) {
const entitiesMap = {}
const result = {}
const output = { entities: entitiesMap }
const addToMap = (x) => {
Function getRoutes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
getRoutes () {
const routes_by_path = {}
const remapRoutes = (routes, path = '') => {
for (let i = routes.length - 1; i >= 0; i--) {
addRoute(routes[i], path)
- 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 api_only
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def api_only(fn):
@wraps(fn)
def wrapped(*args, **kwargs):
accepted = set(request.accept_mimetypes.values())
explicit = not(not request.args.get("json", 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 __call__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, soup, data, url=None):
if data.get("description", False):
return
for query in [dict(id="content"),
- 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 configureStore
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function configureStore (initialState) {
let middlewares = getExtensions('storeMiddlewares')
if (__DEBUG__) {
// we concat to make sure we aren't messing with
// with the extensions list itself but create a copy
Function __eq__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __eq__(self, other):
url = urlparse(other)
for p in ("scheme", "netloc", "path", "hostname", "port",
"username", "password", "params"):
- 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 __call__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, soup, data, url=None):
if not _matches(data, type="article"):
return
if not data.get("copyright", 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 paginate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function paginate ({ types, mapActionToKey }) {
if (!Array.isArray(types) || types.length !== 3) {
throw new Error('Expected types to be an array of three elements.')
}
if (!types.every(t => typeof t === 'string')) {
- 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 __call__
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, soup, data, url=None):
if not _matches(data,
generator=lambda x: x.lower().startswith("mediawiki")
) or data.get("type", False):
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 getRoutes
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
getRoutes () {
const routes_by_path = {}
const remapRoutes = (routes, path = '') => {
for (let i = routes.length - 1; i >= 0; i--) {
addRoute(routes[i], path)
Function deep_map_translations_in
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def deep_map_translations_in(path, ignore={}):
all_translations = {}
for root, dirs, files in os.walk(path):
for name in files:
with open(os.path.join(root, name)) as f:
- 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 deepmerge
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def deepmerge(a, b):
"merges b into a"
for key in b:
if key in a:
if isinstance(a[key], dict) and isinstance(b[key], dict):
- 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 make_env
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def make_env(app):
# environment-based configuration loading
env = Environments(app, var_name="BEAVY_ENV")
env.from_yaml(os.path.join(BASE_DIR, 'config.yml'))
- 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"