bykovme/nswallet

View on GitHub

Showing 226 of 488 total issues

File LoginScreenViewModel.cs has 262 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.ComponentModel;
using Xamarin.Forms;
using NSWallet.Shared;
Severity: Minor
Found in src/NSWallet/NSWallet/ViewModel/LoginScreen/LoginScreenViewModel.cs - About 2 hrs to fix

    File BackupManager.cs has 258 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using NSWallet.Controls.EntryPopup;
    using NSWallet.Shared;
    using NSWallet.Shared.Helpers.Logs.AppLog;
    using Xamarin.Forms;
    Severity: Minor
    Found in src/NSWallet/NSWallet/Helpers/Backups/BackupManager.cs - About 2 hrs to fix

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

          [TestFixture]
          public class BusinessFixture
          {
              const string defaultIcon = "document";
              const string defaultLang = "en";
      Severity: Minor
      Found in src/NSWallet/NSWallet.UnitTests/BusinessFixture.cs - About 2 hrs to fix

        Method AddMenu has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                void AddMenu(StackLayout stack, string modelCommand, string menuName, string menuIcon, string automationId, bool newFeature = false)
                {
                    var itemMenuStack = new StackLayout
                    {
                        VerticalOptions = LayoutOptions.CenterAndExpand,
        Severity: Major
        Found in src/NSWallet/NSWallet/Views/MainScreen/MainMenuView.cs - About 2 hrs to fix

          Method PrepareScreenViewByType has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  void PrepareScreenViewByType(object obj = null)
                  {
                      try {
                          name = "";
                          NSWFormsLabelModel nswFormsLabel;

            Method ExecuteSelectedItemCommand has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
            Open

                    void ExecuteSelectedItemCommand(object obj)
                    {
                        IsEditItemPanel = false;
                        IsEditFolderPanel = false;
                        if (obj == null) return;
            Severity: Minor
            Found in src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs - 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 GetSubscriptionPrice has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public static async Task<string> GetSubscriptionPrice()
                    {
                        var billing = CrossInAppBilling.Current;
                        var errorPrice = TR.Tr("price_loading_failed");
            
            
            Severity: Minor
            Found in src/NSWallet/NSWallet/Premium/PremiumManagement.cs - About 2 hrs to fix

              Method ExecuteBackCommand has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      void ExecuteBackCommand()
                      {
                          IsEditItemPanel = false;
                          IsEditFolderPanel = false;
                          ItemToScrollTo = BL.CurrentItemID;
              Severity: Minor
              Found in src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs - About 1 hr to fix

                Method GetPurchases has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
                Open

                        public static async Task<PremiumStatus> GetPurchases()
                        {
                            try
                            {
                                // Temporary BETA for Mac Desktop version
                Severity: Minor
                Found in src/NSWallet/NSWallet/Premium/PremiumManagement.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 getItems has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        List<ItemList> getItems()
                        {
                            var itemList = new List<ItemList>();
                            var groups = BL.GetGroups();
                            var iconsPremade = IconGroups.GetIconsWithGroups();

                  Method UpdateBackup has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public static void UpdateBackup(string pathFrom, string pathTo, bool isAuthorized = false)
                          {
                              try {
                                  bool errorState = false;
                                  var tempDBFolder = createTempDBFolder();
                  Severity: Minor
                  Found in src/NSWallet/NSWallet/Helpers/Backups/BackupManager.cs - About 1 hr to fix

                    Method onActionSend has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            void onActionSend()
                            {
                                try {
                                    if (Intent.Action == Intent.ActionSend) {
                                        var uriFromExtras = Intent.GetParcelableExtra(Intent.ExtraStream) as Android.Net.Uri;
                    Severity: Minor
                    Found in src/NSWallet/Droid/MainActivity.cs - About 1 hr to fix

                      Method DecryptStringAES has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public static string DecryptStringAES(byte[] encryptedData, string password, int reEncryptionCount, string hash, out bool ok)
                              {
                                  ok = false;
                      
                                  var key = prepareKey(password, hash, reEncryptionCount);
                      Severity: Minor
                      Found in src/NSWallet/NSWallet.Shared/Security/SecurityStandard.cs - About 1 hr to fix

                        Method LocalizationExceptionsLangBG has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                static bool LocalizationExceptionsLangBG(string trTag)
                                {
                                    switch (trTag)
                                    {
                                        case "airplane":

                          Method ReloadGroupedContainerList has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  private void ReloadGroupedContainerList()
                                  {
                                      var colCount = DesiredColumnCount;
                                      var flowGroupsList = new List<FlowGroup>(FlowItemsSource.Count);
                                      var groupDisplayPropertyName = (FlowGroupDisplayBinding as Binding)?.Path;
                          Severity: Minor
                          Found in src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs - About 1 hr to fix

                            Method ExecuteLoginCommand has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    protected void ExecuteLoginCommand(object obj)
                                    {
                                        if (LicenseController.CheckPrivacyPolicy()) {
                                            if (LicenseController.CheckTermsOfUse()) {
                                                AnimationStatus = 0; // 0 - Nothing happened
                            Severity: Minor
                            Found in src/NSWallet/NSWallet/ViewModel/LoginScreen/LoginScreenViewModel.cs - About 1 hr to fix

                              Method EnumerateItems has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      static void EnumerateItems(string id, bool recursive = false)
                                      {
                                          try {
                                              foreach (var item in BL.GetListByParentID(id, true)) {
                                                  if (!recursive)
                              Severity: Minor
                              Found in src/NSWallet/iOS/Interfaces/ExportService.cs - About 1 hr to fix

                                Method EnumerateItems has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        static void EnumerateItems(string id, bool recursive = false)
                                        {
                                            try {
                                                foreach (var item in BL.GetListByParentID(id, true)) {
                                                    if (!recursive)
                                Severity: Minor
                                Found in src/NSWallet/Droid/Interfaces/ExportService.cs - About 1 hr to fix

                                  Method EnumerateItems has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          static void EnumerateItems(string id, bool recursive = false)
                                          {
                                              try {
                                                  foreach (var item in BL.GetListByParentID(id, true)) {
                                                      if (!recursive)
                                  Severity: Minor
                                  Found in src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs - About 1 hr to fix

                                    Method CheckPreviousPremium has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
                                    Open

                                            public static bool CheckPreviousPremium(Page page)
                                            {
                                                try
                                                {
                                                    bool premiumRecovered = false;
                                    Severity: Minor
                                    Found in src/NSWallet/NSWallet/Premium/PremiumManagement.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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language