nbostech/wavelabs-client-api

View on GitHub

Showing 6 of 8 total issues

Method login has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

 def login(login_params = nil, access_token = nil)
  login_model = create_login_model(login_params)

  if login_params.present? && check_login_params(login_params)
      url_path = base_api_url(LOGIN_URI)
Severity: Minor
Found in lib/wavelabs_client_api/client/api/core/auth_api.rb - About 1 hr to fix

    Method login has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def login(social_params, provider, access_token)
      social_uri = get_scoial_login_uri(provider)
      url_path = base_api_url(social_uri)
    
       connection_options = { :clientId => client_id, 
    Severity: Minor
    Found in lib/wavelabs_client_api/client/api/core/social_api.rb - About 1 hr to fix

      Method login has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

       def login(login_params = nil, access_token = nil)
        login_model = create_login_model(login_params)
      
        if login_params.present? && check_login_params(login_params)
            url_path = base_api_url(LOGIN_URI)
      Severity: Minor
      Found in lib/wavelabs_client_api/client/api/core/auth_api.rb - About 55 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

      Method initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def initialize(token_details_params = nil)
            if token_details_params.present? 
              @username = token_details_params["username"]
              @expiration = token_details_params["expiration"]
              @clientId = token_details_params["clientId"]

      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

      Method send_request_with_token has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

                 def send_request_with_token(method, url, access_token, body = nil, query = nil)
      Severity: Minor
      Found in lib/wavelabs_client_api/client/api/core/base_api.rb - About 35 mins to fix

        Method login has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def login(social_params, provider, access_token)
          social_uri = get_scoial_login_uri(provider)
          url_path = base_api_url(social_uri)
        
           connection_options = { :clientId => client_id, 
        Severity: Minor
        Found in lib/wavelabs_client_api/client/api/core/social_api.rb - About 25 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