AuthorizeNet/sdk-dotnet

View on GitHub

Showing 74 of 545 total issues

Method batchStatisticType has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
Open

        public static void batchStatisticType(batchStatisticType argument)
        {
            if (null != argument)
            {
                if (0 <= argument.returnedItemAmount) { argument.returnedItemAmountSpecified = true; }
Severity: Minor
Found in Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs - About 1 hr 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 createProfile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        private Boolean createProfile(out String customerProfileId, out String paymentProfileId)
        {

            ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
            ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment;

    Method SampleCodeCreateCreditRequestForSettledTransaction has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            [Test]
            [Ignore("Requires user to specify settled transaction")]
            public void SampleCodeCreateCreditRequestForSettledTransaction()
            {
                var rnd = new AnetRandom(DateTime.Now.Millisecond);

      Method TransactionRequest_HandleError has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              [Test]
              public void TransactionRequest_HandleError()
              {
                  LogHelper.info(Logger, "CreateProfileWithCreateTransactionRequestTest");
      
      

        Method DecryptPaymentDataRequestTest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                [Test]
                public void DecryptPaymentDataRequestTest()
                {
                    LogHelper.info(Logger, "decryptPaymentDataRequestTest");
        
        
        Severity: Minor
        Found in AuthorizeNETtest/Api/Controllers/Test/CreateTransactionTest.cs - About 1 hr to fix

          Method CreateCreditRequestForSettledECheckTransaction has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  [Test]
                  [Ignore("Requires user to specify settled transaction")]
                  public void CreateCreditRequestForSettledECheckTransaction()
                  {
                      var rnd = new AnetRandom(DateTime.Now.Millisecond);

            Method TestSubscription_serialization_error has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    [Test]
                    public void TestSubscription_serialization_error()
                    {
                        var rnd = new AnetRandom(DateTime.Now.Millisecond);
                        ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
            Severity: Minor
            Found in AuthorizeNETtest/Api/Controllers/Test/ArbSubscriptionTest.cs - About 1 hr to fix

              Method MockcreateCustomerProfileTransactionTest has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      [Test]
                      public void MockcreateCustomerProfileTransactionTest()
                      {
                          //define all mocked objects as final
                          var mockController = GetMockController<createCustomerProfileTransactionRequest, createCustomerProfileTransactionResponse>();

                Method transactionRequestType has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public static void transactionRequestType(transactionRequestType argument)
                        {
                            if (null != argument)
                            {
                                if (0 <= argument.amount) { argument.amountSpecified = true; }
                Severity: Minor
                Found in Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs - About 1 hr to fix

                  Method Execute has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public void Execute(AuthorizeNet.Environment environment = null)
                          {
                              BeforeExecute();
                  
                              Logger.debug(string.Format(CultureInfo.InvariantCulture, "Executing Request:'{0}'", XmlUtility.GetXml(GetApiRequest())));
                  Severity: Minor
                  Found in Authorize.NET/Api/Controllers/Bases/ApiOperationBase.cs - About 1 hr to fix

                    Method MockgetTransactionListTest has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            [Test]
                            public void MockgetTransactionListTest()
                            {
                                //define all mocked objects as final
                                var mockController = GetMockController<getTransactionListRequest, getTransactionListResponse>();

                      Method MockgetUnsettledTransactionListTest has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              [Test]
                              public void MockgetUnsettledTransactionListTest()
                              {
                                  //define all mocked objects as final
                                  var mockController = GetMockController<getUnsettledTransactionListRequest, getUnsettledTransactionListResponse>();

                        Method MockgetSettledBatchListTest has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                [Test]
                                public void MockgetSettledBatchListTest()
                                {
                                    //define all mocked objects as final
                                    var mockController = GetMockController<getSettledBatchListRequest, getSettledBatchListResponse>();

                          Method CreateTransactionInvalidRequestSchemaValidationTest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  [Test]
                                  public void CreateTransactionInvalidRequestSchemaValidationTest()
                                  {
                                      ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
                                      ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment;
                          Severity: Minor
                          Found in AuthorizeNETtest/Api/Controllers/Test/CreateTransactionTest.cs - About 1 hr to fix

                            Method transactionDetailsType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public static void transactionDetailsType(transactionDetailsType argument)
                                    {
                                        if (null != argument)
                                        {
                                            subscriptionPaymentType(argument.subscription);
                            Severity: Minor
                            Found in Authorize.NET/Api/Contracts/V1/RequestFactoryWithSpecified.cs - About 1 hr to fix

                              Method SampleCodeCreateTransactionWithVisaCheckOut has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      [Test]
                                      [Ignore("To run this test, use dataKey, dataValue, callId details and Merchant ApiLoginIdKey and TransactionKey to configure this test below.")]
                                      public void SampleCodeCreateTransactionWithVisaCheckOut()
                                      {
                                          // The test setup.

                                Method SampleCodeCreateTransactionWithApplePay has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        [Test]
                                        [Ignore("To run this test, use your ApplePay ApiLoginIdKey and TransactionKey to configure this test below.")]
                                        public void SampleCodeCreateTransactionWithApplePay()
                                        {
                                            // The test setup.

                                  Method Create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          public WebRequest Create(Uri uri)
                                          {
                                              SerializationInfo si = new SerializationInfo(typeof(HttpWebRequest), new System.Runtime.Serialization.FormatterConverter());
                                              StreamingContext sc = new StreamingContext();
                                              WebHeaderCollection headers = new WebHeaderCollection();
                                  Severity: Minor
                                  Found in AuthorizeNETtest/WebRequestLocal.cs - About 1 hr to fix

                                    Method GetTransactionId has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            private long GetTransactionId()
                                            {
                                                //Creates a credit card transaction and returns the transactions ID.
                                    
                                                //Common code to set for all requests

                                      Method TestSubscription has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              [Test]
                                              public void TestSubscription() {
                                                  var rnd = new AnetRandom(DateTime.Now.Millisecond);
                                                  ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
                                                  ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment;
                                      Severity: Minor
                                      Found in AuthorizeNETtest/Api/Controllers/Test/ArbSubscriptionTest.cs - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language