bykovme/nswallet

View on GitHub

Showing 226 of 488 total issues

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

            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

              Method ThemeSelector has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public void ThemeSelector(bool premium)
                      {
                          string[] buttons = null;
                          if (premium) {
                              buttons = new string[]
              Severity: Minor
              Found in src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs - About 1 hr to fix

                Method CheckPassword has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public bool CheckPassword()
                        {
                            if(password!=null&&pathToDatabase!=null)
                            {
                                if(compareDBVersions()==false)
                Severity: Minor
                Found in src/NSWallet/NSWallet.Console/Checkpass.cs - About 1 hr to fix

                  Method CreateItem has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

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

                    Method saveIcons has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                    Open

                            static void saveIcons(List<ImageModel> images, IconSet iconSet)
                            {
                                if (images != null)
                                {
                                    if (images.Count > 0)
                    Severity: Minor
                    Found in src/NSWallet/NSWallet.Shared/Upgrades/UpgradeTo02.cs - About 55 mins 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 AddCheckbox has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            void AddCheckbox(StackLayout settingsLayout, string settingName, string checkedProperty, string menuIcon, string toggleCommand, string chosenSelectionProperty = null, bool isPremium = false)
                    Severity: Major
                    Found in src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs - About 50 mins to fix

                      Method popupWithList has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              StackLayout popupWithList(string selectedProperty, string itemSourceProperty, string iconProperty, string nameProperty, string headerText = null, string headerIcon = null, string headerCommandProperty = null)
                      Severity: Major
                      Found in src/NSWallet/NSWallet/Views/MainScreen/Fields/ManageFieldView.cs - About 50 mins to fix

                        Method CreateLabel has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                public bool CreateLabel(string fieldType, string name, string valueType, string icon, bool system, string changed, bool deleted)
                        Severity: Major
                        Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs - About 50 mins to fix

                          Method CreateField has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  public void CreateField(string itemID, string fieldID, string type, byte[] value, string changeTimestamp, bool deleted, int sortWeight)
                          Severity: Major
                          Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs - About 50 mins to fix

                            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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language