bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                          for (int i = 0; i < containerCount; i++)
                          {
                              var view = (View)templates[i].CreateContent();
      
                              view.GestureRecognizers.Add(new TapGestureRecognizer()
      src/NSWallet/NSWallet/Controls/FlowListView/FlowListViewInternalCell.cs on lines 421..438

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 144.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                          for (int i = 0; i < containerCount; i++)
                          {
                              var view = (View)templates[i].CreateContent();
      
                              view.GestureRecognizers.Add(new TapGestureRecognizer()
      src/NSWallet/NSWallet/Controls/FlowListView/FlowListViewInternalCell.cs on lines 397..414

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 144.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              [Test]
              public void CopyItem()
              {
                  BL.SetCurrentItemID(GConsts.ROOTID);
                  var itemId = BL.AddItem(itemName, defaultIcon, false);
      Severity: Major
      Found in src/NSWallet/NSWallet.UnitTests/BusinessFixture.cs and 1 other location - About 1 hr to fix
      src/NSWallet/NSWallet.UnitTests/BusinessFixture.cs on lines 301..310

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              [Test]
              public void CopyFolder()
              {
                  BL.SetCurrentItemID(GConsts.ROOTID);
                  var itemId = BL.AddItem(itemName, defaultIcon, true);
      Severity: Major
      Found in src/NSWallet/NSWallet.UnitTests/BusinessFixture.cs and 1 other location - About 1 hr to fix
      src/NSWallet/NSWallet.UnitTests/BusinessFixture.cs on lines 290..299

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 143.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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();

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                public List<string> ReadZip(string path)
                {
                    try {
                        var zip = ZipFile.OpenRead(path);
                        var entries = new List<string>();
        Severity: Major
        Found in src/NSWallet/NSWallet.Mac/Interfaces/FileService.cs and 2 other locations - About 1 hr to fix
        src/NSWallet/Droid/Interfaces/FileService.cs on lines 195..212
        src/NSWallet/iOS/Interfaces/FileService.cs on lines 175..198

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                public List<string> ReadZip(string path)
                {
                    try
                    {
                        var zip = ZipFile.OpenRead(path);
        Severity: Major
        Found in src/NSWallet/iOS/Interfaces/FileService.cs and 2 other locations - About 1 hr to fix
        src/NSWallet/Droid/Interfaces/FileService.cs on lines 195..212
        src/NSWallet/NSWallet.Mac/Interfaces/FileService.cs on lines 147..164

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                public List<string> ReadZip(string path)
                {
                    try {
                        var zip = ZipFile.OpenRead(path);
                        var entries = new List<string>();
        Severity: Major
        Found in src/NSWallet/Droid/Interfaces/FileService.cs and 2 other locations - About 1 hr to fix
        src/NSWallet/NSWallet.Mac/Interfaces/FileService.cs on lines 147..164
        src/NSWallet/iOS/Interfaces/FileService.cs on lines 175..198

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 141.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      void ExecuteCopyCommand()
                      {
                          if (currentItemType != ItemTypes.Item) {
                              if (!string.IsNullOrEmpty(pasteItemID)) {
                                  BL.CopyItem(pasteItemID);
              src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs on lines 1432..1449

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 138.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      void ExecuteMoveCommand()
                      {
                          if (currentItemType != ItemTypes.Item) {
                              if (!string.IsNullOrEmpty(pasteItemID)) {
                                  BL.MoveItem(pasteItemID);
              src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs on lines 1406..1423

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 138.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      private void FlowListViewItemDisappearing(object sender, ItemVisibilityEventArgs e)
                      {
                          var container = e.Item as IEnumerable;
                          if (container != null)
                          {
              Severity: Major
              Found in src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs and 1 other location - About 1 hr to fix
              src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs on lines 460..479

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 137.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      private void FlowListViewItemAppearing (object sender, ItemVisibilityEventArgs e)
                      {
                          var container = e.Item as IEnumerable;
                          if (container != null)
                          {
              Severity: Major
              Found in src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs and 1 other location - About 1 hr to fix
              src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs on lines 481..500

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 137.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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 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
                  Severity
                  Category
                  Status
                  Source
                  Language