bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

Method changeGroup has 37 lines of code (exceeds 25 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 1 hr to fix

    Method ConvertDBDateTime has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public static DateTime ConvertDBDateTime(string dbDateTime)
            {
                int year, month, day, hour, minute, second;
    
                if (dbDateTime == null)
    Severity: Minor
    Found in src/NSWallet/NSWallet.Shared/Helpers/Common.cs - About 1 hr to fix

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

      using Xamarin.Forms;
      using Xamarin.Forms.Platform.Android;
      using NSWallet;
      using NSWallet.Droid;
      using Android.Views;
      Severity: Major
      Found in src/NSWallet/Droid/CustomRenderers/CustomEditorRenderer.cs and 3 other locations - About 1 hr to fix
      src/NSWallet/Droid/CustomRenderers/CustomDatePickerRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/CustomTimePickerRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/RectangularEntryRenderer.cs on lines 1..30

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

      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

      using Xamarin.Forms;
      using Xamarin.Forms.Platform.Android;
      using NSWallet;
      using NSWallet.Droid;
      using Android.Views;
      src/NSWallet/Droid/CustomRenderers/CustomEditorRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/CustomTimePickerRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/RectangularEntryRenderer.cs on lines 1..30

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

      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 (NSLocale.PreferredLanguages.Length > 0) {
                      var pref = NSLocale.PreferredLanguages[0];
                      prefLanguageOnly = pref.Substring(0, 2);
                      if (prefLanguageOnly == "pt") {
                          if (pref == "pt")
      Severity: Major
      Found in src/NSWallet/NSWallet.Mac/Interfaces/Localization.cs and 1 other location - About 1 hr to fix
      src/NSWallet/iOS/Helpers/Localization.cs on lines 36..49

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

      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

      using Xamarin.Forms;
      using Xamarin.Forms.Platform.Android;
      using NSWallet;
      using NSWallet.Droid;
      using Android.Views;
      src/NSWallet/Droid/CustomRenderers/CustomDatePickerRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/CustomEditorRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/CustomTimePickerRenderer.cs on lines 1..28

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

      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

      using Xamarin.Forms;
      using Xamarin.Forms.Platform.Android;
      using NSWallet;
      using NSWallet.Droid;
      using Android.Views;
      src/NSWallet/Droid/CustomRenderers/CustomDatePickerRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/CustomEditorRenderer.cs on lines 1..28
      src/NSWallet/Droid/CustomRenderers/RectangularEntryRenderer.cs on lines 1..30

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

      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 (NSLocale.PreferredLanguages.Length > 0)
                  {
                      var pref = NSLocale.PreferredLanguages[0];
                      prefLanguageOnly = pref.Substring(0, 2);
                      if (prefLanguageOnly == "pt")
      Severity: Major
      Found in src/NSWallet/iOS/Helpers/Localization.cs and 1 other location - About 1 hr to fix
      src/NSWallet/NSWallet.Mac/Interfaces/Localization.cs on lines 33..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 116.

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

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

      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

                      {
                          var premiumImage = new CachedImage
                          {
                              HeightRequest = 30,
                              HorizontalOptions = LayoutOptions.EndAndExpand,
      src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs on lines 596..610

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

      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

                      {
                          var premiumImage = new CachedImage
                          {
                              HeightRequest = 30,
                              HorizontalOptions = LayoutOptions.EndAndExpand,
      src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs on lines 499..513

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

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

              static string getHTMLFromItems()
              {
                  string html = null;
                  foreach (var item in ExportedItems) {
                      string marginLeft = null;
      Severity: Minor
      Found in src/NSWallet/iOS/Interfaces/ExportService.cs - About 1 hr to fix

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

                {
                    if (navigation != null) {
                        var page = new AdminScreenView(navigation);
                        navigation.PushAsync(page);
                    } else {
        Severity: Major
        Found in src/NSWallet/NSWallet/Views/Pages.cs and 1 other location - About 1 hr to fix
        src/NSWallet/NSWallet/Views/Pages.cs on lines 234..250

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

        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

                    if (DependencyService.Get<IPermission>().ReadWritePermission) {
        
                        if (navigation != null) {
                            var page = new BackupScreenView(navigation);
                            navigation.PushAsync(page);
        Severity: Major
        Found in src/NSWallet/NSWallet/Views/Pages.cs and 1 other location - About 1 hr to fix
        src/NSWallet/NSWallet/Views/Pages.cs on lines 54..69

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

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

                protected void ExecuteSaveFieldCommand()
                {
                    try {
                        string updText = null;
        
        

          Method UpdateIcon has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public bool UpdateIcon(string iconID, string name, byte[] blob = null, int groupID = -1, int isCircle = -1)
                  {
                      try {
                          CheckConnection();
                          BeginTransaction();
          Severity: Minor
          Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs - About 1 hr to fix

            Method GetListByParentID has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public static List<NSWItem> GetListByParentID(string parentID, bool setAsCurrent)
                    {
                        List<NSWItem> filteredList;
                        if (parentID == GConsts.EXPIRING_SOON_ID) {
                            filteredList = GetExpiringItems();
            Severity: Minor
            Found in src/NSWallet/NSWallet.Shared/Business/BusinessLayerItems.cs - About 1 hr to fix

              Method DecryptStringAES_IOS has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public static string DecryptStringAES_IOS(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/SecurityiOSWorkAround.cs - About 1 hr to fix

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

                        public string SearchText {
                            get { return searchText; }
                            set {
                                if (searchText == value)
                                    return;
                src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs on lines 35..52

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

                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

                        public string SearchText {
                            get { return searchText; }
                            set {
                                if (searchText == value)
                                    return;
                src/NSWallet/NSWallet/ViewModel/MainScreen/ItemCreation/MainScreenChooseIconViewModel.cs on lines 60..77

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

                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

                Severity
                Category
                Status
                Source
                Language