bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

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

        [Test]
        public void StressShortStrings()
        {
            

Severity: Major
Found in src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs and 2 other locations - About 3 hrs to fix
src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs on lines 39..58
src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs on lines 60..80

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

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

        [Test]
        public void StressLongStrings()
        {

            for (int i = 0; i < NORMAL_ITERATION; i++)
Severity: Major
Found in src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs and 2 other locations - About 3 hrs to fix
src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs on lines 17..37
src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs on lines 60..80

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

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

        [Test]
        public void StressHugeStrings()
        {
            

Severity: Major
Found in src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs and 2 other locations - About 3 hrs to fix
src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs on lines 17..37
src/NSWallet/NSWallet.UnitTests/SecurityStressFixture.cs on lines 39..58

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

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 changeGroup has a Cognitive Complexity of 41 (exceeds 20 allowed). Consider refactoring.
Open

        void changeGroup(ItemModel item)
        {
            PopupPagesUIController.LaunchChangeGroupPopup((x) => {
                if (x.Result != TR.Cancel) {
                    Device.BeginInvokeOnMainThread(() => {
Severity: Minor
Found in src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs - About 3 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 OnBindingContextChanged has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        protected override void OnBindingContextChanged()
        {
            base.OnBindingContextChanged();

            var container = BindingContext as IList;

    Class AppPages has 30 methods (exceeds 20 allowed). Consider refactoring.
    Open

        public static class AppPages
        {
            public static void Main()
            {
                var navPage = new NavigationPage(new MainScreenView())
    Severity: Minor
    Found in src/NSWallet/NSWallet/Views/Pages.cs - About 3 hrs to fix

      File BusinessFixture.cs has 318 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      using System.IO;
      using NSWallet.Shared;
      using NUnit.Framework;
      
      namespace NSWallet.UnitTests
      Severity: Minor
      Found in src/NSWallet/NSWallet.UnitTests/BusinessFixture.cs - About 3 hrs to fix

        File DefaultTheme.cs has 316 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using Xamarin.Forms;
        
        namespace NSWallet
        {
            public class DefaultTheme : ITheme
        Severity: Minor
        Found in src/NSWallet/NSWallet/Themes/DefaultTheme.cs - About 3 hrs to fix

          Method LocalizationExceptionsCommon has 88 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  static bool LocalizationExceptionsCommon(string trTag)
                  {
                      switch (trTag)
                      {
                          case "admin_password_placeholder":

            Method ExecuteSelectedItemCommand has 88 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    void ExecuteSelectedItemCommand(object obj)
                    {
                        IsEditItemPanel = false;
                        IsEditFolderPanel = false;
                        if (obj == null) return;
            Severity: Major
            Found in src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs - About 3 hrs to fix

              File Pages.cs has 311 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              using System;
              using System.Collections.Generic;
              using NSWallet.Enums;
              using NSWallet.NetStandard;
              using NSWallet.NetStandard.Interfaces;
              Severity: Minor
              Found in src/NSWallet/NSWallet/Views/Pages.cs - About 3 hrs to fix

                Method ExecuteMenuTappedCommand has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        void ExecuteMenuTappedCommand(object obj)
                        {
                            if (obj != null) {
                                var popupItem = (PopupItem)obj;
                                switch (popupItem.Action) {
                Severity: Major
                Found in src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs - About 3 hrs to fix

                  File LabelScreenViewModel.cs has 309 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  using System;
                  using System.Collections.Generic;
                  using System.Collections.ObjectModel;
                  using System.ComponentModel;
                  using System.Diagnostics;
                  Severity: Minor
                  Found in src/NSWallet/NSWallet/ViewModel/LabelsScreen/LabelScreenViewModel.cs - About 3 hrs to fix

                    Method AddCheckbox has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            void AddCheckbox(StackLayout settingsLayout, string settingName, string checkedProperty, string menuIcon, string toggleCommand, string chosenSelectionProperty = null, bool isPremium = false)
                            {
                                var checkboxLayout = new StackLayout {
                                    VerticalOptions = LayoutOptions.CenterAndExpand,
                                    HorizontalOptions = LayoutOptions.Fill,
                    Severity: Major
                    Found in src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs - About 3 hrs to fix

                      Method GeneratePDF has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring.
                      Open

                              public void GeneratePDF()
                              {
                                  CleanCache();
                      
                                  // Get NSWItems
                      Severity: Minor
                      Found in src/NSWallet/Droid/Interfaces/ExportService.cs - About 3 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

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

                              List<ItemList> searchByText(string text)
                              {
                                  var loweredText = text.ToLower();
                                  var searchResult = new List<ItemList>();
                                  foreach (var item in savedList) {
                      src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs on lines 59..87

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

                      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

                              List<ItemList> searchByText(string text)
                              {
                                  var loweredText = text.ToLower();
                                  var searchResult = new List<ItemList>();
                                  foreach (var item in savedList) {
                      Severity: Major
                      Found in src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs and 1 other location - About 3 hrs to fix
                      src/NSWallet/NSWallet/ViewModel/MainScreen/ItemCreation/MainScreenChooseIconViewModel.cs on lines 84..112

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

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

                              StackLayout popupWithList(string selectedProperty, string itemSourceProperty, string iconProperty, string nameProperty, string headerText = null, string headerIcon = null, string headerCommandProperty = null)
                              {
                                  var listLayout = new StackLayout { Spacing = 0 };
                      
                                  if (headerText != null) {
                      Severity: Major
                      Found in src/NSWallet/NSWallet/Views/MainScreen/Fields/ManageFieldView.cs - About 3 hrs to fix

                        Method GetPurchases has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public static async Task<PremiumStatus> GetPurchases()
                                {
                                    try
                                    {
                                        // Temporary BETA for Mac Desktop version
                        Severity: Major
                        Found in src/NSWallet/NSWallet/Premium/PremiumManagement.cs - About 2 hrs to fix

                          Method LocalizationExceptionsLangPT has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  static bool LocalizationExceptionsLangPT(string trTag)
                                  {
                                      switch (trTag)
                                      {
                                          case "premium_status":
                            Severity
                            Category
                            Status
                            Source
                            Language