bjerkio/crayon-api-go

View on GitHub

Showing 152 of 602 total issues

SubscriptionDetailed has 24 methods (exceeds 20 allowed). Consider refactoring.
Open

type SubscriptionDetailed struct {

    // available addons count
    AvailableAddonsCount int32 `json:"AvailableAddonsCount,omitempty"`

Severity: Minor
Found in models/subscription_detailed.go - About 2 hrs to fix

    Method GetAsyncParams.WriteToRequest has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
    Open

    func (o *GetAsyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        if err := r.SetTimeout(o.timeout); err != nil {
            return err
        }
    Severity: Minor
    Found in client/reseller_sales_prices/get_async_parameters.go - About 2 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

    Method GetCurrentAsyncParams.WriteToRequest has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
    Open

    func (o *GetCurrentAsyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        if err := r.SetTimeout(o.timeout); err != nil {
            return err
        }
    Severity: Minor
    Found in client/reseller_sales_prices/get_current_async_parameters.go - About 2 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

    Method DeleteByFilterAsyncParams.WriteToRequest has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
    Open

    func (o *DeleteByFilterAsyncParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        if err := r.SetTimeout(o.timeout); err != nil {
            return err
        }
    Severity: Minor
    Found in client/reseller_sales_prices/delete_by_filter_async_parameters.go - About 2 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

    Method GetConsumersParams.WriteToRequest has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
    Open

    func (o *GetConsumersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        if err := r.SetTimeout(o.timeout); err != nil {
            return err
        }
    Severity: Minor
    Found in client/consumers/get_consumers_parameters.go - About 2 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

    Method GetOrganizationAccessParams.WriteToRequest has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
    Open

    func (o *GetOrganizationAccessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        if err := r.SetTimeout(o.timeout); err != nil {
            return err
        }
    Severity: Minor
    Found in client/organization_access/get_organization_access_parameters.go - About 2 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

    Method GetInvoiceProfilesParams.WriteToRequest has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
    Open

    func (o *GetInvoiceProfilesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        if err := r.SetTimeout(o.timeout); err != nil {
            return err
        }
    Severity: Minor
    Found in client/invoice_profiles/get_invoice_profiles_parameters.go - About 2 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

    GetActivityLogsParams has 23 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type GetActivityLogsParams struct {
    
        /*Entity*/
        Entity *string
        /*From*/
    Severity: Minor
    Found in client/activity_logs/get_activity_logs_parameters.go - About 2 hrs to fix

      AgreementProductCollection has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

      type AgreementProductCollection struct {
      
          // agreements
          Agreements []*ObjectReference `json:"Agreements"`
      
      
      Severity: Minor
      Found in models/agreement_product_collection.go - About 2 hrs to fix

        Function main has 81 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func main() {
            resp, err := http.Get("https://api.crayon.com/swagger/v1/swagger.json")
            if err != nil {
                panic(err)
            }
        Severity: Major
        Found in internal/cmd/convert-swagger/main.go - About 2 hrs to fix

          Method GetProgramsParams.WriteToRequest has 80 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (o *GetProgramsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
          
              if err := r.SetTimeout(o.timeout); err != nil {
                  return err
              }
          Severity: Major
          Found in client/programs/get_programs_parameters.go - About 2 hrs to fix

            GetForSubcategoryParams has 21 methods (exceeds 20 allowed). Consider refactoring.
            Open

            type GetForSubcategoryParams struct {
            
                /*Category*/
                Category string
                /*CurrencyCode*/
            Severity: Minor
            Found in client/usage_cost/get_for_subcategory_parameters.go - About 2 hrs to fix

              GetBillingStatementsParams has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type GetBillingStatementsParams struct {
              
                  /*From*/
                  From *strfmt.DateTime
                  /*InvoiceProfileID*/
              Severity: Minor
              Found in client/billing_statements/get_billing_statements_parameters.go - About 2 hrs to fix

                GetCrayonAccountsParams has 21 methods (exceeds 20 allowed). Consider refactoring.
                Open

                type GetCrayonAccountsParams struct {
                
                    /*ConsumerID*/
                    ConsumerID *int32
                    /*CustomerTenantType*/
                Severity: Minor
                Found in client/crayon_accounts/get_crayon_accounts_parameters.go - About 2 hrs to fix

                  GetAwsAccountsParams has 21 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  type GetAwsAccountsParams struct {
                  
                      /*ConsumerID*/
                      ConsumerID *int32
                      /*CustomerTenantType*/
                  Severity: Minor
                  Found in client/aws_accounts/get_aws_accounts_parameters.go - About 2 hrs to fix

                    Asset has 21 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    type Asset struct {
                    
                        // asset type
                        // Enum: [Reservation Software Subscription]
                        AssetType string `json:"AssetType,omitempty"`
                    Severity: Minor
                    Found in models/asset.go - About 2 hrs to fix

                      Subscription has 21 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      type Subscription struct {
                      
                          // available addons count
                          AvailableAddonsCount int32 `json:"AvailableAddonsCount,omitempty"`
                      
                      
                      Severity: Minor
                      Found in models/subscription.go - About 2 hrs to fix

                        GetGroupedBillingStatementsParams has 21 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        type GetGroupedBillingStatementsParams struct {
                        
                            /*From*/
                            From *strfmt.DateTime
                            /*InvoiceProfileID*/

                          Method GetAgreementsParams.WriteToRequest has 20 return statements (exceeds 4 allowed).
                          Open

                          func (o *GetAgreementsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                          
                              if err := r.SetTimeout(o.timeout); err != nil {
                                  return err
                              }
                          Severity: Major
                          Found in client/agreements/get_agreements_parameters.go - About 1 hr to fix

                            Method GetProductContainersParams.WriteToRequest has 19 return statements (exceeds 4 allowed).
                            Open

                            func (o *GetProductContainersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                            
                                if err := r.SetTimeout(o.timeout); err != nil {
                                    return err
                                }
                            Severity: Major
                            Found in client/product_containers/get_product_containers_parameters.go - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language