CenterForOpenScience/waterbutler

View on GitHub

Showing 62 of 92 total issues

File provider.py has 1001 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import copy
import json
import time
import uuid
import asyncio
Severity: Major
Found in waterbutler/providers/github/provider.py - About 2 days to fix

    File provider.py has 856 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import json
    import asyncio
    import hashlib
    import logging
    from typing import Tuple
    Severity: Major
    Found in waterbutler/providers/figshare/provider.py - About 2 days to fix

      File provider.py has 688 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import abc
      import time
      import typing
      import asyncio
      import logging
      Severity: Major
      Found in waterbutler/core/provider.py - About 1 day to fix

        File provider.py has 650 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import json
        import typing
        import asyncio
        import logging
        from http import HTTPStatus
        Severity: Major
        Found in waterbutler/providers/onedrive/provider.py - About 1 day to fix

          File provider.py has 625 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import os
          import hashlib
          import logging
          import functools
          from urllib import parse
          Severity: Major
          Found in waterbutler/providers/s3/provider.py - About 1 day to fix

            File provider.py has 590 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import json
            import base64
            import hashlib
            import logging
            import tempfile
            Severity: Major
            Found in waterbutler/providers/box/provider.py - About 1 day to fix

              File provider.py has 575 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import os
              import json
              import hashlib
              import functools
              from urllib import parse
              Severity: Major
              Found in waterbutler/providers/googledrive/provider.py - About 1 day to fix

                File provider.py has 537 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import os
                import json
                import uuid
                import typing
                import asyncio
                Severity: Major
                Found in waterbutler/providers/osfstorage/provider.py - About 1 day to fix

                  File provider.py has 490 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import json
                  import typing
                  import logging
                  from http import HTTPStatus
                  
                  
                  Severity: Minor
                  Found in waterbutler/providers/dropbox/provider.py - About 7 hrs to fix

                    Function _determine_actions has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                    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,
                    Severity: Minor
                    Found in waterbutler/auth/osf/handler.py - About 6 hrs to fix

                    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

                    import time
                    import base64
                    import typing
                    import hashlib
                    import logging
                    Severity: Minor
                    Found in waterbutler/providers/googlecloud/provider.py - About 5 hrs to fix

                      File provider.py has 378 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import json
                      import typing
                      import logging
                      import mimetypes
                      
                      
                      Severity: Minor
                      Found in waterbutler/providers/gitlab/provider.py - About 5 hrs to fix

                        File provider.py has 378 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import logging
                        from typing import Tuple
                        from urllib.parse import urlencode
                        
                        from waterbutler.core import exceptions, provider, streams
                        Severity: Minor
                        Found in waterbutler/providers/bitbucket/provider.py - About 5 hrs to fix

                          File provider.py has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import os
                          import hmac
                          import json
                          import time
                          import asyncio
                          Severity: Minor
                          Found in waterbutler/providers/cloudfiles/provider.py - About 3 hrs to fix

                            File remote_logging.py has 322 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import json
                            import time
                            import asyncio
                            import logging
                            
                            
                            Severity: Minor
                            Found in waterbutler/core/remote_logging.py - About 3 hrs to fix

                              File metadata.py has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import abc
                              import typing
                              import hashlib
                              
                              import furl
                              Severity: Minor
                              Found in waterbutler/core/metadata.py - About 3 hrs to fix

                                WaterButlerPath has 27 functions (exceeds 20 allowed). Consider refactoring.
                                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
                                Severity: Minor
                                Found in waterbutler/core/path.py - About 3 hrs to fix

                                  File zip.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import zlib
                                  import time
                                  import struct
                                  import asyncio
                                  import logging
                                  Severity: Minor
                                  Found in waterbutler/core/streams/zip.py - About 3 hrs to fix

                                    File provider.py has 267 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import hashlib
                                    import logging
                                    import tempfile
                                    from typing import Tuple
                                    from http import HTTPStatus
                                    Severity: Minor
                                    Found in waterbutler/providers/dataverse/provider.py - About 2 hrs to fix

                                      File provider.py has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      import aiohttp
                                      
                                      from waterbutler.core import streams
                                      from waterbutler.core import provider
                                      from waterbutler.core import exceptions
                                      Severity: Minor
                                      Found in waterbutler/providers/owncloud/provider.py - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language