psono/psono-server

View on GitHub

Showing 423 of 423 total issues

Function backblaze_construct_signed_upload_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def backblaze_construct_signed_upload_url(bucket, region, access_key_id, secret_access_key, hash_checksum):
Severity: Minor
Found in psono/restapi/utils/backblaze.py - About 35 mins to fix

    Function create_signature_string has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def create_signature_string(method, path, content_md5, content_type, expiration):
    Severity: Minor
    Found in psono/restapi/utils/gcp.py - About 35 mins to fix

      Function backblaze_delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def backblaze_delete(bucket, region, access_key_id, secret_access_key, hash_checksum):
      Severity: Minor
      Found in psono/restapi/utils/backblaze.py - About 35 mins to fix

        Function api_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def api_request(method, endpoint, data = None, token = None, session_secret_key = None):
        Severity: Minor
        Found in examples/api_key_with_session.py - About 35 mins to fix

          Function create_user has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def create_user(username, password, email, gen_authkey=True, display_name=''):
          Severity: Minor
          Found in psono/restapi/utils/various.py - About 35 mins to fix

            Function api_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def api_request(method, endpoint, data = None, token = None, session_secret_key = None):
            Severity: Minor
            Found in examples/create_secret_in_share.py - About 35 mins to fix

              Function api_write_share has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def api_write_share(token, session_secret_key, share_id, encrypted_data, encrypted_data_nonce):
              Severity: Minor
              Found in examples/create_secret_in_share.py - About 35 mins to fix

                Function api_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def api_request(method, endpoint, data = None, token = None, session_secret_key = None):
                Severity: Minor
                Found in examples/create_secret_in_datastore.py - About 35 mins to fix

                  Function azure_blob_construct_signed_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def azure_blob_construct_signed_url(storage_account_name, storage_account_primary_key, container_name, hash_checksum, permission):
                  Severity: Minor
                  Found in psono/restapi/utils/azure_blob.py - About 35 mins to fix

                    Function api_update_secret has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def api_update_secret(token, session_secret_key, secret_id, data, data_nonce):
                    Severity: Minor
                    Found in examples/api_key_with_session.py - About 35 mins to fix

                      Function aws_construct_signed_download_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def aws_construct_signed_download_url(bucket, region, access_key_id, secret_access_key, hash_checksum):
                      Severity: Minor
                      Found in psono/restapi/utils/aws.py - About 35 mins to fix

                        Function duo_auth_enroll_status has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def duo_auth_enroll_status(integration_key: str, secret_key: str, host: str, user_id: str, activation_code: str) -> dict:
                        Severity: Minor
                        Found in psono/restapi/utils/duo.py - About 35 mins to fix

                          Function user_has_rights_on_share has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def user_has_rights_on_share(user_id: str, share_id: Union[str, List[str]], read: bool = None, write: bool = None, grant: bool = None) -> Union[None, bool, List[bool]]:
                          Severity: Minor
                          Found in psono/restapi/utils/various.py - About 35 mins to fix

                            Function aws_construct_signed_upload_url has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def aws_construct_signed_upload_url(bucket, region, access_key_id, secret_access_key, hash_checksum):
                            Severity: Minor
                            Found in psono/restapi/utils/aws.py - About 35 mins to fix

                              Function aws_delete has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def aws_delete(bucket, region, access_key_id, secret_access_key, hash_checksum):
                              Severity: Minor
                              Found in psono/restapi/utils/aws.py - About 35 mins to fix

                                Function api_write_datastore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def api_write_datastore(token, session_secret_key, datastore_id, encrypted_data, encrypted_data_nonce):
                                Severity: Minor
                                Found in examples/create_secret_in_datastore.py - About 35 mins to fix

                                  Function post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def post(self, request, *args, **kwargs):
                                          """
                                          Lists multiple secrets
                                  
                                          Necessary Rights:
                                  Severity: Minor
                                  Found in psono/restapi/views/bulk_secret_read.py - About 35 mins 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

                                  Function link_shard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  def link_shard(cluster_id: str, shard_id: str, permission: str, fix_link_id=None) -> dict:
                                  
                                      if not cluster_id or cluster_id == 'None':
                                          return {
                                              'error': 'CLUSTER_ID required'
                                  Severity: Minor
                                  Found in psono/restapi/management/commands/fsshardlink.py - About 35 mins 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

                                  Function get_shares has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def get_shares(self, user):
                                  
                                              # Generates a list of shares wherever the user has any rights for it and joins the user_share objects
                                  
                                              specific_right_share_index = {}
                                  Severity: Minor
                                  Found in psono/restapi/views/share.py - About 35 mins 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

                                  Function put has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      def put(self, request, *args, **kwargs):
                                          """
                                          Prepares a chunk upload to a file repository
                                  
                                          :param request:
                                  Severity: Minor
                                  Found in psono/restapi/views/file_repository_upload.py - About 35 mins 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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language