bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

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

            var buildNumber = new Label {
                Text = String.Format("{0}: {1}", TR.Tr("build_label"), PlatformSpecific.GetBuildNumber()),
                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 4 other locations - About 1 hr to fix
src/NSWallet/NSWallet/Views/AboutScreen/AboutScreenView.cs on lines 54..61
src/NSWallet/NSWallet/Views/AboutScreen/AboutScreenView.cs on lines 67..74
src/NSWallet/NSWallet/Views/AdminScreen/AdminScreenView.cs on lines 72..79
src/NSWallet/NSWallet/Views/AdminScreen/AdminScreenView.cs on lines 90..97

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

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 5 locations. Consider refactoring.
Open

            var platform = new Label {
                Text = String.Format("{0}: {1}", TR.Tr("platform_label"), PlatformSpecific.GetPlatform()),
                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 4 other locations - About 1 hr to fix
src/NSWallet/NSWallet/Views/AboutScreen/AboutScreenView.cs on lines 54..61
src/NSWallet/NSWallet/Views/AboutScreen/AboutScreenView.cs on lines 67..74
src/NSWallet/NSWallet/Views/AdminScreen/AdminScreenView.cs on lines 72..79
src/NSWallet/NSWallet/Views/AdminScreen/AdminScreenView.cs on lines 81..88

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

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

            mainStackLayout.SizeChanged += (sender, e) => {
                try
                {
                    if (buttonsLayout != null)
                    {
Severity: Major
Found in src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs and 1 other location - About 1 hr to fix
src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs on lines 115..124

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

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

            mainStackLayout.SizeChanged += (sender, e) => {
                try {
                    if (buttonsLayout != null) {
                        mainStackLayout.Children.Remove(buttonsLayout);
                        mainStackLayout.Children.Add(buttonsLayout);
Severity: Major
Found in src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs and 1 other location - About 1 hr to fix
src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs on lines 135..148

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

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

        protected void ExecuteRestorePremiumCommand()
        {
            if (restored)
            {
                Task.Run(async () =>

    Method OnElementChanged has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            protected override void OnElementChanged(ElementChangedEventArgs<FloatingActionButton> e)
            {
                base.OnElementChanged(e);
    
                if (Control == null)

      Method EncryptStringAES has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public static byte[] EncryptStringAES(string plainText, string password, int reEncryptionCount, string hash, out bool ok)
              {
                  ok = false;
                  byte[] bytes;
      
      
      Severity: Minor
      Found in src/NSWallet/NSWallet.Shared/Security/SecurityStandard.cs - About 1 hr to fix

        Method GenerateTXT has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public void GenerateTXT()
                {
                    CleanCache();
        
                    // Get NSWItems
        Severity: Minor
        Found in src/NSWallet/NSWallet.Mac/Interfaces/ExportService.cs - About 1 hr to fix

          Method GenerateTXT has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public void GenerateTXT()
                  {
                      CleanCache();
          
                      // Get NSWItems
          Severity: Minor
          Found in src/NSWallet/Droid/Interfaces/ExportService.cs - About 1 hr to fix

            Method GenerateCleverPassword has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public static string GenerateCleverPassword(string passwordPattern)
                    {
                        Random rand = new Random(DateTime.Now.Millisecond);
            
                        var generatedPassword = "";
            Severity: Minor
            Found in src/NSWallet/NSWallet.Shared/Security/SecurityStandard.cs - About 1 hr to fix

              Method GetItemMenu has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      static Grid GetItemMenu()
                      {
                          var itemEditLayout = new Grid {
                              BackgroundColor = Theme.Current.AppHeaderBackground,
                              HorizontalOptions = LayoutOptions.FillAndExpand,
              Severity: Minor
              Found in src/NSWallet/NSWallet/Views/MainScreen/MainScreenViewItemMenu.cs - About 1 hr to fix

                Method EnterPassword has 29 lines of code (exceeds 25 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

                  Method ExecuteOpenMenuCommand has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          protected void ExecuteOpenMenuCommand(object item)
                          {
                              if (item != null) {
                                  var itemMdl = (ItemModel)item;
                                  if (itemMdl.IconID != premadeIconIdentifier) {
                  Severity: Minor
                  Found in src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs - About 1 hr to fix

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

                            public void CreateLabel()
                            {
                                var popup = new EntryPopup(TR.Tr("create_label"), null, false);
                                popup.PopupClosed += (o, closedArgs) => {
                                    if (closedArgs.OkClicked) {
                    Severity: Minor
                    Found in src/NSWallet/NSWallet/Views/LabelScreen/LabelScreenView.cs - About 1 hr to fix

                      Method updateList has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              void updateList()
                              {
                                  try {
                                      var backupPath = PlatformSpecific.GetBackupPath();
                                      var backupFiles = PlatformSpecific.GetFileNames(backupPath);

                        Method LanguageSelector has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                public void LanguageSelector()
                                {
                                    var langs = Lang.availableLangs();
                                    var strLangs = new List<string>();
                                    var systemLang = "";
                        Severity: Minor
                        Found in src/NSWallet/NSWallet/Views/SettingsScreen/SettingsScreenView.cs - About 1 hr to fix

                          Method ExecuteTapGestureRecognizer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  async Task ExecuteTapGestureRecognizer(View view)
                                  {
                                      var flowCell = view as IFlowViewCell;
                                      if (flowCell != null)
                                      {

                            Method ExecuteThemeSelectedCommand has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    protected void ExecuteThemeSelectedCommand(string selectedTheme)
                                    {
                                        string themeCode = null;
                            
                                        if (!string.IsNullOrEmpty(selectedTheme) && string.Compare(selectedTheme, TR.Cancel) != 0) {

                              Method fontAdd has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      static void fontAdd(string name, string typeface, bool beginning = false)
                                      {
                                          if (Device.RuntimePlatform == Device.Android) {
                                              if (typeface != null) {
                                                  typeface = typeface + fontExtension + "#" + typeface;
                              Severity: Minor
                              Found in src/NSWallet/NSWallet/Helpers/Fonts/NSWFontsController.cs - About 1 hr to fix

                                Method GetCurrentCultureInfo has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        public System.Globalization.CultureInfo GetCurrentCultureInfo()
                                        {
                                            var netLanguage = "en";
                                            var prefLanguageOnly = "en";
                                            if (NSLocale.PreferredLanguages.Length > 0)
                                Severity: Minor
                                Found in src/NSWallet/iOS/Helpers/Localization.cs - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language