bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

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

            try {
                if (obj != null) {
                    var popupItem = (PopupItem)obj;
                    switch (popupItem.Action) {
                        case "DeleteBackupCommand":
src/NSWallet/NSWallet/ViewModel/LabelsScreen/LabelScreenViewModel.cs on lines 341..356

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

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 CheckForColumnInGroups(string column)
        {
            var table = conn.Table<nswallet_groups>();
            if (table != null) {
                if (table.Table != null) {
src/NSWallet/NSWallet.Shared/Database/NSWalletDBupgrade03.cs on lines 52..64

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

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 CheckForColumnInIcons(string column)
        {
            var table = conn.Table<nswallet_icons>();
            if (table != null) {
                if (table.Table != null) {
src/NSWallet/NSWallet.Shared/Database/NSWalletDBupgrade03.cs on lines 66..78

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

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 (obj != null) {
                var popupItem = (PopupItem)obj;
                switch (popupItem.Action) {
                    case "ChangeTitleCommand":
src/NSWallet/NSWallet/ViewModel/BackupScreen/BackupScreenViewModel.cs on lines 237..252

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

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

        void setItemsList(List<NSWItem> itemsList, bool setHeader = true)
        {
            var itemsStorage = new List<NSWFormsItemModel>();
            if (itemsList != null) {
                if (itemsList.Count == 0) {
Severity: Minor
Found in src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs - About 1 hr to fix

    Method GetButtons has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public static Layout<View> GetButtons()
            {
                var mainLayout = new StackLayout();
                mainLayout.SetBinding(VisualElement.IsVisibleProperty, "IsVisibleProp");
                mainLayout.Orientation = StackOrientation.Horizontal;
    Severity: Minor
    Found in src/NSWallet/NSWallet/Views/Social/SocialView.cs - About 1 hr to fix

      Method ExecuteCreateCommand has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              protected void ExecuteCreateCommand(object obj)
              {
      
                  var iconModel = (IconModel)obj;
      
      

        Method ChangeItemTitle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public void ChangeItemTitle()
                {
                    var currentState = BL.GetCurrentItem();
                    string changeTitle = null;
                    string emptyItem = null;
        Severity: Minor
        Found in src/NSWallet/NSWallet/Views/MainScreen/MainScreenView.cs - About 1 hr to fix

          Method CreateItem has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public void CreateItem(string itemID, string parentID, byte[] name, string icon,
                                         bool folder, string createTimestamp, string changeTimestamp, bool deleted)
                  {
                      try
                      {
          Severity: Minor
          Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs - About 1 hr to fix

            Method ShowPopup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public void ShowPopup(EntryPopup popup)
                    {
                        var alert = new AlertDialog.Builder(Forms.Context);
            
                        var edit = new EditText(Forms.Context) { Text = popup.Text };
            Severity: Minor
            Found in src/NSWallet/Droid/Interfaces/EntryPopup.cs - About 1 hr to fix

              Method CreateLabel has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public bool CreateLabel(string fieldType, string name, string valueType, string icon, bool system, string changed, bool deleted)
                      {
                          try
                          {
                              CheckConnection();
              Severity: Minor
              Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs - About 1 hr to fix

                Method SetCultureInfo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        static void SetCultureInfo(string langCode)
                        {
                            CultureInfo culture = null;
                
                            try {
                Severity: Minor
                Found in src/NSWallet/NSWallet.Shared/Localization/Translations.cs - About 1 hr to fix

                  Method AddSystemLabels has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public static void AddSystemLabels(bool reset = false)
                          {
                              var dal = DataAccessLayer.GetInstance();
                  
                              if (reset) {
                  Severity: Minor
                  Found in src/NSWallet/NSWallet.Shared/Business/BusinessLayerLabels.cs - About 1 hr to fix

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

                            {
                                try
                                {
                                    CheckConnection();
                                    return conn.Table<nswallet_items>().Any(item => item.item_id == GConsts.ROOTID);
                    Severity: Major
                    Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs and 1 other location - About 1 hr to fix
                    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 153..161

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

                    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

                                            Device.BeginInvokeOnMainThread(() => {
                                                Application.Current.MainPage.DisplayAlert(TR.Tr("attention"), TR.Tr("main_paste_field_description"), TR.OK);
                                                AddButtonVisible = false;
                                                IsCopyEnabled = true;
                                                IsMoveEnabled = false;
                    src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs on lines 1277..1283

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

                    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

                                Device.BeginInvokeOnMainThread(() => {
                                    Application.Current.MainPage.DisplayAlert(TR.Tr("attention"), TR.Tr("main_paste_field_description"), TR.OK);
                                    AddButtonVisible = false;
                                    IsCopyEnabled = true;
                                    IsMoveEnabled = false;
                    src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs on lines 1308..1314

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

                    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 appDatabaseVersion = new Label {
                                    Text = TR.Tr("db_version_name") + ": " + BL.StorageProperties.Version,
                                    FontSize = FontSizeController.GetSize(NamedSize.Small, typeof(Label)),
                                    HorizontalTextAlignment = TextAlignment.Center,
                                    FontAttributes = FontAttributes.Bold,
                    Severity: Major
                    Found in src/NSWallet/NSWallet/Views/AboutScreen/AboutScreenView.cs and 1 other location - About 1 hr to fix
                    src/NSWallet/NSWallet/Views/AdminScreen/AdminScreenView.cs on lines 99..106

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

                    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

                            {
                                try {
                                    CheckConnection();
                                    return conn.Table<nswallet_items>().SingleOrDefault(item => item.item_id == GConsts.ROOTID);
                                } catch (Exception ex) {
                    Severity: Major
                    Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs and 1 other location - About 1 hr to fix
                    src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs on lines 139..150

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

                    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 appDatabaseVersion = new Label {
                                    Text = TR.Tr("db_version_name") + ": " + BL.StorageProperties.Version,
                                    FontSize = FontSizeController.GetSize(NamedSize.Small, typeof(Label)),
                                    HorizontalTextAlignment = TextAlignment.Start,
                                    FontAttributes = FontAttributes.Bold,
                    Severity: Major
                    Found in src/NSWallet/NSWallet/Views/AdminScreen/AdminScreenView.cs and 1 other location - About 1 hr to fix
                    src/NSWallet/NSWallet/Views/AboutScreen/AboutScreenView.cs on lines 87..94

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

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

                            public byte[] ResizeImage(byte[] imageData, float width, float height)
                            {
                                var options = new BitmapFactory.Options {
                                    InPurgeable = true
                                };
                    Severity: Minor
                    Found in src/NSWallet/Droid/Helpers/MediaService.cs - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language