bykovme/nswallet

View on GitHub

Showing 226 of 488 total issues

Method CustomActionButton has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        static StackLayout CustomActionButton(string icon, string text, string command)
        {
            var iconLabel = new Label {
                HorizontalOptions = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center,

    Method GetSettingsIcon has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            static Grid GetSettingsIcon(bool solid, string iconFont, string iconText, string popupCommandName = "")
            {
                var icon = new Label {
                    TextColor = Theme.Current.MainTitleTextColor,
                    FontSize = 40,
    Severity: Minor
    Found in src/NSWallet/NSWallet/Views/MainScreen/MainScreenViewHelpers.cs - About 1 hr to fix

      Method GetFieldTypeNameByShortName has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public static string GetFieldTypeNameByShortName(string fieldTypeShortName)
              {
                  switch (fieldTypeShortName) {
                      case GConsts.FLDTYPE_ACNT:
                          return TR.Tr("ACNT");
      Severity: Minor
      Found in src/NSWallet/NSWallet.Shared/Business/BusinessLayer.cs - About 1 hr to fix

        Method TestCaseDecrypt has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                [Test]
                public void TestCaseDecrypt()
                {
                    const string password = "Sun001!";
                    const string expectedString = "nhh86c4uQKXu8rTjp4sL8rr2fxRMmnhWWhan8LiaVb4ZhTdF4RTlX4xcHYjwsfDu";
        Severity: Minor
        Found in src/NSWallet/NSWallet.UnitTests/SecurityFixture.cs - About 1 hr to fix

          Method CheckPreviousPremium has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public static bool CheckPreviousPremium(Page page)
                  {
                      try
                      {
                          bool premiumRecovered = false;
          Severity: Minor
          Found in src/NSWallet/NSWallet/Premium/PremiumManagement.cs - About 1 hr to fix

            Method EnterPassword has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
            Open

                    public void EnterPassword()
                    {
                        // FIXME: create correct model view separation, change password should go to model!!!
                        var popup = new EntryPopup(TR.Tr("enter_new_password"), string.Empty, true);
                        popup.PopupClosed += (o, closedArgs) => {
            Severity: Minor
            Found in src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs - About 1 hr 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 AddListButton has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    static void AddListButton(StackLayout stack, string modelCommand, string menuName, string menuIcon)
                    {
                        var itemsImportLayout = new StackLayout {
                            VerticalOptions = LayoutOptions.CenterAndExpand,
                            HorizontalOptions = LayoutOptions.Fill,

              Method ChangePassword has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public bool ChangePassword(string newPassword)
                      {
                          try
                          {
                              nswdb.BeginTransaction();
              Severity: Minor
              Found in src/NSWallet/NSWallet.Shared/DataAccess/DataAccessLayer.cs - About 1 hr to fix

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

                        static async Task<bool> wasSubscriptionPurchased(string productID)
                        {
                            var billing = CrossInAppBilling.Current;
                
                            try
                Severity: Minor
                Found in src/NSWallet/NSWallet/Premium/PremiumManagement.cs - About 1 hr to fix

                  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

                      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

                      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

                        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

                                Method CreatePanelButton has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        static Grid CreatePanelButton(string btnIcon, string btnText)
                                        {
                                            var icon = new Label {
                                                FontFamily = NSWFontsController.FontAwesomeRegular,
                                                TextColor = Theme.Current.MainTitleTextColor,

                                  Method CheckLocalizationFiles has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          [Test]
                                          public void CheckLocalizationFiles()
                                          {
                                              var langs = Lang.availableLangs();
                                  
                                  
                                  Severity: Minor
                                  Found in src/NSWallet/NSWallet.UnitTests/Resources/ResourcesFixture.cs - About 1 hr to fix

                                    Method GetCurrentPath has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                            public static string GetCurrentPath()
                                            {
                                                if (CurrentItemID == GConsts.EXPIRING_SOON_ID)
                                                {
                                                    return "/" + TR.Tr("expiringsoon_folder") + "/";
                                    Severity: Minor
                                    Found in src/NSWallet/NSWallet.Shared/Business/BusinessLayer.cs - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language