bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

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

        public static bool InsertGroup(int groupID, string name)
        {
            var dal = DataAccessLayer.GetInstance();
            var result = dal.InsertGroup(groupID, name);
            ResetData(false, false, false, false, true);
Severity: Minor
Found in src/NSWallet/NSWallet.Shared/Business/BusinessLayer.cs and 1 other location - About 45 mins to fix
src/NSWallet/NSWallet.Shared/Business/BusinessLayer.cs on lines 373..379

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

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

        static NSWItem GetMostlyViewedFolder()
        {
            var nswItem = new NSWItem
            {
                ItemID = GConsts.MOSTLY_VIEWED_ID,
Severity: Major
Found in src/NSWallet/NSWallet.Shared/Business/BusinessLayerItems.cs and 2 other locations - About 45 mins to fix
src/NSWallet/NSWallet.Shared/Business/BusinessLayerItems.cs on lines 223..238
src/NSWallet/NSWallet.Shared/Business/BusinessLayerItems.cs on lines 240..255

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

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 ExecuteAutoLoginCommand()
        {
            if (IsAutoLoginChecked) {
                // Checked code below
                IsAutoLoginChecked = true;
src/NSWallet/NSWallet/ViewModel/SettingsScreen/SettingsScreenViewModel.cs on lines 1109..1122

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

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

        static void CleanCache()
        {
            var backupPath = PlatformSpecific.GetBackupPath();
            var directories = Directory.EnumerateDirectories(backupPath);
            foreach (var directory in directories) {
Severity: Major
Found in src/NSWallet/iOS/Interfaces/ExportService.cs and 2 other locations - About 45 mins to fix
src/NSWallet/Droid/Interfaces/ExportService.cs on lines 25..34
src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs on lines 26..35

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

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

        static void CleanCache()
        {
            var backupPath = PlatformSpecific.GetBackupPath();
            var directories = Directory.EnumerateDirectories(backupPath);
            foreach(var directory in directories) {
Severity: Major
Found in src/NSWallet/Droid/Interfaces/ExportService.cs and 2 other locations - About 45 mins to fix
src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs on lines 26..35
src/NSWallet/iOS/Interfaces/ExportService.cs on lines 35..44

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

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

        static void CleanCache()
        {
            var backupPath = PlatformSpecific.GetBackupPath();
            var directories = Directory.EnumerateDirectories(backupPath);
            foreach (var directory in directories) {
Severity: Major
Found in src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs and 2 other locations - About 45 mins to fix
src/NSWallet/Droid/Interfaces/ExportService.cs on lines 25..34
src/NSWallet/iOS/Interfaces/ExportService.cs on lines 35..44

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

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

            if (!buttons) {
                var closeToolbarItem = new ToolbarItem();
                closeToolbarItem.Text = TR.Close;
                closeToolbarItem.Icon = Theme.Current.CloseIcon;
                closeToolbarItem.Clicked += (sender, e) => Navigation.PopModalAsync();
Severity: Minor
Found in src/NSWallet/NSWallet/Views/License/LicensePageView.cs and 1 other location - About 45 mins to fix
src/NSWallet/NSWallet/Views/BackupScreen/BackupScreenView.cs on lines 37..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 76.

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

        public static void LaunchAlertPopup(Action<Task<bool>> action)
        {
            PopupUIController.LaunchMessageBox(TR.Tr("alert"), TR.Tr("export_import_alert"), TR.Tr("continue"), TR.Cancel, action);
        }
src/NSWallet/NSWallet/Helpers/UI/Popups/Pages/SignIn/SignInPagePopupUIController.cs on lines 9..12
src/NSWallet/NSWallet/Helpers/UI/Popups/Pages/SignIn/SignInPagePopupUIController.cs on lines 14..17

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

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

        public static void LaunchTermsOfUsePopup(Action<Task<bool>> action)
        {
            PopupUIController.LaunchMessageBox(TR.Tr("alert"), TR.Tr("terms_of_use_description"), TR.Tr("terms_of_use_read_and_accept"), TR.Cancel, action);
        }
src/NSWallet/NSWallet/Helpers/UI/Popups/Pages/ExportImport/ExportImportPopupUIController.cs on lines 9..12
src/NSWallet/NSWallet/Helpers/UI/Popups/Pages/SignIn/SignInPagePopupUIController.cs on lines 9..12

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

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

            if (navigation != null) {
                var closeToolbarItem = new ToolbarItem();
                closeToolbarItem.Text = TR.Close;
                closeToolbarItem.Icon = Theme.Current.CloseIcon;
                closeToolbarItem.Clicked += (sender, e) => Navigation.PopModalAsync();
Severity: Minor
Found in src/NSWallet/NSWallet/Views/BackupScreen/BackupScreenView.cs and 1 other location - About 45 mins to fix
src/NSWallet/NSWallet/Views/License/LicensePageView.cs on lines 17..23

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

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

        public static void LaunchPrivacyPolicyPopup(Action<Task<bool>> action)
        {
            PopupUIController.LaunchMessageBox(TR.Tr("alert"), TR.Tr("privacy_policy_description"), TR.Tr("privacy_policy_read_and_accept"), TR.Cancel, action);
        }
src/NSWallet/NSWallet/Helpers/UI/Popups/Pages/ExportImport/ExportImportPopupUIController.cs on lines 9..12
src/NSWallet/NSWallet/Helpers/UI/Popups/Pages/SignIn/SignInPagePopupUIController.cs on lines 14..17

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

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

Avoid deeply nested control flow statements.
Open

                                if (nowDateTime.Subtract(backupDate).Days > Settings.BackupDeletion)
                                    PlatformSpecific.RemoveFile(backupPath + "/" + backupFile);
Severity: Major
Found in src/NSWallet/NSWallet/Helpers/Backups/BackupManager.cs - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                        if (Settings.UsedFingerprintBefore) {
                                            Settings.FingerprintCount = 21;
                                            Settings.RememberedPassword = closedArgs.Text;
                                        }
    Severity: Major
    Found in src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (name.ToLower().Contains(loweredText)) {
                                      itemList.Title = item.Title;
                                      itemList.Add(new ItemModel {
                                          Icon = innerItem.Icon,
                                          Name = innerItem.Name,
      Severity: Major
      Found in src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                                if (!string.IsNullOrEmpty(e.Text)) {
                                                    var groups = BL.GetGroups();
                                                    var lastID = groups.Max(g => g.GroupID);
                                                    var result = BL.InsertGroup(lastID + 1, e.Text);
                                                    if (result) {
        Severity: Major
        Found in src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              if (BL.CheckPassword(password)) {
                                                  Settings.UsedFingerprintBefore = true;
                                                  Settings.RememberedPassword = password;
                                                  setFingerprintChecked(value);
                                              } else {

            Avoid deeply nested control flow statements.
            Open

                                            if (string.Compare(extension, FileController.Zip) == 0) {
                                                mimeType = FileController.ApplicationZipMimeType;
                                            }
            Severity: Major
            Found in src/NSWallet/Droid/MainActivity.cs - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (Password.Length >= GConsts.MASTER_PASSWORD_RESTRICTION || CheckPassword.Length >= GConsts.MASTER_PASSWORD_RESTRICTION) {
                                              if (string.Compare(Password, CheckPassword) == 0) {
                                                  BL.CreateOnlyRootItem(Password);
                                                  BL.CreateSampleItems();
                                                  Settings.ChangePasswordUnicodeIOSBug = true;
              Severity: Major
              Found in src/NSWallet/NSWallet/ViewModel/LoginScreen/LoginScreenViewModel.cs - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if (name.ToLower().Contains(loweredText)) {
                                                itemList.Title = item.Title;
                                                itemList.Add(new ItemModel {
                                                    Icon = innerItem.Icon,
                                                    Name = innerItem.Name,

                  Method AddSettingButton has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          void AddSettingButton(StackLayout stack, string modelCommand, string menuName, string menuIcon, string chosenSelectionProperty = null, bool isPremium = false)
                  Severity: Minor
                  Found in src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language