Showing 74 of 545 total issues
Method batchStatisticType
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
Open
public static void batchStatisticType(batchStatisticType argument)
{
if (null != argument)
{
if (0 <= argument.returnedItemAmount) { argument.returnedItemAmountSpecified = true; }
- Read upRead up
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
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
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
Open
[Test]
public void TransactionRequest_HandleError()
{
LogHelper.info(Logger, "CreateProfileWithCreateTransactionRequestTest");
Method DecryptPaymentDataRequestTest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
[Test]
public void DecryptPaymentDataRequestTest()
{
LogHelper.info(Logger, "decryptPaymentDataRequestTest");
Method CreateCreditRequestForSettledECheckTransaction
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
[Test]
public void TestSubscription_serialization_error()
{
var rnd = new AnetRandom(DateTime.Now.Millisecond);
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
Method MockcreateCustomerProfileTransactionTest
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
public static void transactionRequestType(transactionRequestType argument)
{
if (null != argument)
{
if (0 <= argument.amount) { argument.amountSpecified = true; }
Method Execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void Execute(AuthorizeNet.Environment environment = null)
{
BeforeExecute();
Logger.debug(string.Format(CultureInfo.InvariantCulture, "Executing Request:'{0}'", XmlUtility.GetXml(GetApiRequest())));
Method MockgetTransactionListTest
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
Open
[Test]
public void CreateTransactionInvalidRequestSchemaValidationTest()
{
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment;
Method transactionDetailsType
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void transactionDetailsType(transactionDetailsType argument)
{
if (null != argument)
{
subscriptionPaymentType(argument.subscription);
Method SampleCodeCreateTransactionWithVisaCheckOut
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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();
Method GetTransactionId
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
[Test]
public void TestSubscription() {
var rnd = new AnetRandom(DateTime.Now.Millisecond);
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = CustomMerchantAuthenticationType;
ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = TestEnvironment;