Showing 543 of 559 total issues
File pika.py
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import json
import logging
import structlog
import os
Function exports
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (context, options) {
const { siteConfig } = context;
const { themeConfig } = siteConfig;
const { gtm } = themeConfig || {};
File utils.py
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import argparse
import logging
import os
import sys
Function serve_application
has 25 arguments (exceeds 4 allowed). Consider refactoring. Open
def serve_application(
Function _create_features_for_token
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def _create_features_for_token(
self,
crf_tokens: List[CRFToken],
token_idx: int,
half_window_size: int,
- 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 story_conflict.py
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
from collections import defaultdict
import logging
import json
from typing import DefaultDict, Dict, Generator, List, NamedTuple, Optional, Text, Tuple
Function convert_predictions_into_entities
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def convert_predictions_into_entities(
text: Text,
tokens: List[Token],
tags: Dict[Text, List[Text]],
split_entities_config: Optional[Dict[Text, bool]] = 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
File plotting.py
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
import logging
import itertools
import os
from functools import wraps
File sidebars.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = {
default: [
"introduction",
"rasa-pro",
{
File botframework.py
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import datetime
import json
import logging
import re
from http import HTTPStatus
Function raise_warning
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def raise_warning(
message: Text,
category: Optional[Type[Warning]] = None,
docs: Optional[Text] = None,
**kwargs: Any,
- 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 _features_for_patterns
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _features_for_patterns(
self, message: Message, attribute: Text
) -> Tuple[Optional[scipy.sparse.coo_matrix], Optional[scipy.sparse.coo_matrix]]:
"""Checks which known patterns match the message.
- 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 kafka.py
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import os
import json
import logging
import structlog
File utils.py
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import logging
import os
from decimal import Decimal
from pathlib import Path
Function injectHtmlTags
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
injectHtmlTags() {
return {
headTags: [
{
tagName: 'link',
File run.py
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
import asyncio
import logging
import uuid
import os
from functools import partial
File lock_store.py
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
import asyncio
from contextlib import asynccontextmanager
import json
import logging
File ensemble.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
from __future__ import annotations
from abc import abstractmethod, ABC
from typing import Optional, Text, List, Dict, Any
import logging
Function configure_app
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
def configure_app(
Function blueprint
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def blueprint(
self, on_new_message: Callable[[UserMessage], Awaitable[Any]]
) -> Blueprint:
"""Defines a Sanic blueprint."""
# Workaround so that socketio works with requests from other origins.
- 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"