Showing 216 of 245 total issues
File action.py
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
import aiohttp
import copy
import json
import logging
DialogueStateTracker
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class DialogueStateTracker(object):
"""Maintains the state of a conversation.
The field max_event_history will only give you these last events,
it can be set in the tracker_store"""
File processor.py
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import logging
from types import LambdaType
from typing import Any, Dict, List, Optional, Text, Tuple
File trackers.py
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
import typing
from collections import deque
import copy
import io
Function requires_auth
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def requires_auth(app: Sanic,
token: Optional[Text] = None
) -> Callable[[Any], Any]:
"""Wraps a request handler with token authentication."""
- 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 check_domain_sanity
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def check_domain_sanity(domain):
"""Make sure the domain is properly configured.
Checks the settings and checks if there are duplicate actions,
intents, slots and entities."""
- 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 generate_all_prior_trackers
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def generate_all_prior_trackers(self):
# type: () -> Generator[DialogueStateTracker, None, None]
"""Returns a generator of the previous trackers of this tracker.
The resulting array is representing
- 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 _merge_equivalent_nodes
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def _merge_equivalent_nodes(graph, max_history):
"""Searches for equivalent nodes in the graph and merges them."""
changed = True
# every node merge changes the graph and can trigger previously
- 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
File test_trackers.py
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import fakeredis
import pytest
import tempfile
Function _create_states
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _create_states(self,
tracker: DialogueStateTracker,
domain: Domain,
is_binary_training: bool = False
) -> List[Dict[Text, float]]:
- 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
File dsl.py
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
import asyncio
import io
import json
import logging
File channel.py
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
from asyncio import Queue, CancelledError
import inspect
import json
File ensemble.py
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
import importlib
import json
import logging
import os
import sys
File test_server.py
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
import json
import os
import tempfile
import uuid
Function get_parsing_states
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def get_parsing_states(self,
tracker: 'DialogueStateTracker'
) -> Dict[Text, float]:
state_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 training_states_and_actions
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def training_states_and_actions(
self,
trackers: List[DialogueStateTracker],
domain: Domain
) -> Tuple[List[List[Dict]], List[List[Text]]]:
- 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 encode
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def encode(self, state: Dict[Text, float]) -> np.ndarray:
if not self.num_features:
raise Exception("LabelTokenizerSingleStateFeaturizer "
"was not prepared before encoding.")
- 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 24 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
File tracker_store.py
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
import itertools
import json
import logging
import pickle
# noinspection PyPep8Naming
Function blueprint
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def blueprint(self, on_new_message):
telegram_webhook = Blueprint('telegram_webhook', __name__)
out_channel = TelegramOutput(self.access_token)
@telegram_webhook.route("/", methods=['GET'])
- 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"