Showing 62 of 92 total issues
File provider.py
has 1001 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import copy
import json
import time
import uuid
import asyncio
File provider.py
has 856 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import asyncio
import hashlib
import logging
from typing import Tuple
File provider.py
has 688 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import abc
import time
import typing
import asyncio
import logging
File provider.py
has 650 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import typing
import asyncio
import logging
from http import HTTPStatus
File provider.py
has 625 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import os
import hashlib
import logging
import functools
from urllib import parse
File provider.py
has 590 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import base64
import hashlib
import logging
import tempfile
File provider.py
has 575 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import os
import json
import hashlib
import functools
from urllib import parse
File provider.py
has 537 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import os
import json
import uuid
import typing
import asyncio
File provider.py
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import typing
import logging
from http import HTTPStatus
Function _determine_actions
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
Open
def _determine_actions(self, resource, provider, request, action=None,
auth_type=AuthType.SOURCE, path='', version=None):
"""Decide what the user is trying to achieve and what permissions they need to achieve it.
Returns two values, ``osf_action`` and ``intended_action``. ``intended_action`` is a tag
that describes what the user is trying to accomplish. This tag can have many values,
- 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 provider.py
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import time
import base64
import typing
import hashlib
import logging
File provider.py
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import typing
import logging
import mimetypes
File provider.py
has 378 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import logging
from typing import Tuple
from urllib.parse import urlencode
from waterbutler.core import exceptions, provider, streams
File provider.py
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import os
import hmac
import json
import time
import asyncio
File remote_logging.py
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import json
import time
import asyncio
import logging
File metadata.py
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import abc
import typing
import hashlib
import furl
WaterButlerPath
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class WaterButlerPath:
""" A standardized and validated immutable WaterButler path. This is our abstraction around
file paths in storage providers. A WaterButlerPath is an array of WaterButlerPathPart objects.
Each PathPart has two important attributes, `value` and `_id`. `value` is always the
human-readable component of the path. If the provider assigns ids to entities (see: Box, Google
File zip.py
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import zlib
import time
import struct
import asyncio
import logging
File provider.py
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import hashlib
import logging
import tempfile
from typing import Tuple
from http import HTTPStatus
File provider.py
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import aiohttp
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions