bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

File FileService.cs has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.IO;
using Xamarin.Forms;
using NSWallet.iOS;
Severity: Minor
Found in src/NSWallet/iOS/Interfaces/FileService.cs - About 2 hrs to fix

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

            public void UpdateLabelIcon(string fieldType, string icon, string change)
            {
                try
                {
                    CheckConnection();
    Severity: Major
    Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs and 3 other locations - About 2 hrs to fix
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 232..252
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 275..294
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 296..312

    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 172.

    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 4 locations. Consider refactoring.
    Open

            public void UpdateItemParentID(string itemID, string parentID, string change)
            {
                try {
                    CheckConnection();
                    BeginTransaction();
    Severity: Major
    Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs and 3 other locations - About 2 hrs to fix
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 211..230
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 232..252
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 275..294

    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 172.

    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 4 locations. Consider refactoring.
    Open

            public void UpdateItemIcon(string itemID, string icon, string change)
            {
                try
                {
                    CheckConnection();
    Severity: Major
    Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs and 3 other locations - About 2 hrs to fix
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 211..230
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 232..252
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 296..312

    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 172.

    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 4 locations. Consider refactoring.
    Open

            public void UpdateLabelTitle(string fieldType, string name, string change)
            {
    
                try
                {
    Severity: Major
    Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs and 3 other locations - About 2 hrs to fix
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 211..230
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 275..294
    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 296..312

    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 172.

    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

            bool diagnoseField(nswallet_fields nswDBField)
            {
                bool flag = false;
    
                if (nswDBField == null) {
    src/NSWallet/NSWallet.Shared/DataAccess/DataAccessLayerDiagnostics.cs on lines 100..127

    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 170.

    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

            bool diagnoseItem(nswallet_items nswDBItem)
            {
                bool flag = false;
    
                if (nswDBItem == null) {
    src/NSWallet/NSWallet.Shared/DataAccess/DataAccessLayerDiagnostics.cs on lines 129..156

    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 170.

    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

    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

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

              public static string ValueTypeByTranslation(string translation)
              {
                  if (translation == TR.Tr(GConsts.VALUETYPE_DATE))
                      return GConsts.VALUETYPE_DATE;
                  if (translation == TR.Tr(GConsts.VALUETYPE_TIME))
      Severity: Major
      Found in src/NSWallet/NSWallet/Helpers/Labels/LabelsManagement.cs and 1 other location - About 2 hrs to fix
      src/NSWallet/NSWallet/Views/LabelScreen/LabelScreenView.cs on lines 150..166

      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 166.

      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 2 locations. Consider refactoring.
      Open

              static string ValueTypeByTranslation(string translation)
              {
                  if (translation == TR.Tr(GConsts.VALUETYPE_DATE))
                      return GConsts.VALUETYPE_DATE;
                  if (translation == TR.Tr(GConsts.VALUETYPE_TIME))
      Severity: Major
      Found in src/NSWallet/NSWallet/Views/LabelScreen/LabelScreenView.cs and 1 other location - About 2 hrs to fix
      src/NSWallet/NSWallet/Helpers/Labels/LabelsManagement.cs on lines 28..43

      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 166.

      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

              protected void ExecuteAutoBackupSelectedCommand(string selectedBackup)
              {
                  if (string.Compare(selectedBackup, TR.Tr("autobackup_no_backup"), StringComparison.Ordinal) == 0) {
                      Settings.AutoBackup = 0;
                  }
      src/NSWallet/NSWallet/ViewModel/SettingsScreen/SettingsScreenViewModel.cs on lines 328..343

      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 164.

      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

              protected void ExecuteExpiringPeriodSelectedCommand(string selected)
              {
                  if (string.Compare(selected, TR.Tr("settings_expiring_period_10"), StringComparison.Ordinal) == 0) {
                      Settings.ExpiringPeriod = 10;
                  }
      src/NSWallet/NSWallet/ViewModel/SettingsScreen/SettingsScreenViewModel.cs on lines 196..211

      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 164.

      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 static string[] WrapString(string text, int max)
              {
                  var charCount = 0;
                  var lines = text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                  return lines.GroupBy(w => (charCount += (((charCount % max) + w.Length + 1 >= max)
      Severity: Major
      Found in src/NSWallet/iOS/Interfaces/ExportService.cs and 2 other locations - About 2 hrs to fix
      src/NSWallet/Droid/Interfaces/ExportService.cs on lines 276..284
      src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs on lines 201..209

      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 162.

      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 static string[] WrapString(string text, int max)
              {
                  var charCount = 0;
                  var lines = text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                  return lines.GroupBy(w => (charCount += (((charCount % max) + w.Length + 1 >= max)
      Severity: Major
      Found in src/NSWallet/Droid/Interfaces/ExportService.cs and 2 other locations - About 2 hrs to fix
      src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs on lines 201..209
      src/NSWallet/iOS/Interfaces/ExportService.cs on lines 225..233

      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 162.

      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 static string[] WrapString(string text, int max)
              {
                  var charCount = 0;
                  var lines = text.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                  return lines.GroupBy(w => (charCount += (((charCount % max) + w.Length + 1 >= max)
      Severity: Major
      Found in src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs and 2 other locations - About 2 hrs to fix
      src/NSWallet/Droid/Interfaces/ExportService.cs on lines 276..284
      src/NSWallet/iOS/Interfaces/ExportService.cs on lines 225..233

      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 162.

      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

      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 PrepareScreenViewByType has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            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 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

              Severity
              Category
              Status
              Source
              Language