Showing 58 of 120 total issues
Function getPaginationElement
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPaginationElement() {
if (!this.props.pagination) return null;
const pagination = this.props.pagination;
const allPages = pagination.get('allPages');
Function renderExpandable
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderExpandable() {
/*eslint-disable react/jsx-key*/
let icons = [
['add_button', <ContentAdd />],
['search_button', <ActionSearch />],
Function render
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
render() {
let contents = (
<div style={{textAlign: "center"}}>
<CircularProgress
size={80}
- 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 getTokens
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
getTokens() {
this.tokenObjects = [];
this.setState({tokens: this.props.expression.map((obj, i) => {
const key = obj.get('key');
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div
style={{
display: "flex",
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
appData,
extraComponent,
store,
Function default
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (field, options={}) {
field = field.toJS();
options = Object.assign({}, {
dataSource: [],
Function getActionsMenu
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
getActionsMenu() {
if (this.props.actions.size == 0) return null;
return (
<ToolbarGroup>
Function renderFAB
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderFAB() {
const isExpanded = this.state.expandFAB;
const icon = (isExpanded) ?
key => <NavigationClose key={key} /> :
key => <ActionSearch key={key} />;
Function tokens
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.setState({tokens: this.props.expression.map((obj, i) => {
const key = obj.get('key');
let fieldset = this.props.fieldsets.get(key);
let values = obj.get('args', null);
const id = obj.get('index');
Function renderGroup
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderGroup(group) {
const depth = group.get('__depth');
const rootGroup = depth == 0;
const offset = depth * 5;
Function tiles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
let tiles = this.props.results.map(record => {
const id = record.get('id', null);
const link = (id) ? this.searchAndDetailsHtml(id) : null;
const groupName = (!id) ? record.get('__groupName') : null;
const extraStyle = (Item.getExtraStyle) ?
Function get_filters
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_filters(self):
if not self.is_multi_modeled:
return self.filters
def check_conversion(filter_name, filter_):
- 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 renderAction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
renderAction() {
const open = !!this.props.currentAction;
let actionData = I.fromJS({});
- 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 es_query
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def es_query(self, body, timeout=None, min_score=None, save_score=True,
save_highlights=True):
es_server = self.model.es_get_server()
path = self.model._elastic["path"]
body = dict(body)
- 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 get_serialized_queryset
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_serialized_queryset(self, queryset):
if self.group_by is None:
return self.get_serializer(queryset, many=True).data
groupers = [getattr(self, "group_by_{}".format(g), None)
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __call__(self, base_expression=None, not_expression=None,
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, table_name, restraint_field=None,
Function exception_handler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def exception_handler(exc, context):
response = rest_exception_handler(exc, context)
if response is None:
if hasattr(exc, "name") and callable(exc.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"
Further reading
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, model, name, commands, **kwargs):