bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

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

                        var labels = new string[]
                        {
                            TR.Tr(GConsts.VALUETYPE_TEXT),
                            TR.Tr(GConsts.VALUETYPE_DATE),
                            TR.Tr(GConsts.VALUETYPE_TIME),
Severity: Major
Found in src/NSWallet/NSWallet/Views/LabelScreen/LabelScreenView.cs and 1 other location - About 1 hr to fix
src/NSWallet/NSWallet/Helpers/Labels/LabelsManagement.cs on lines 15..24

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

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

                return new string[]
                {
                    TR.Tr(GConsts.VALUETYPE_TEXT),
                    TR.Tr(GConsts.VALUETYPE_DATE),
                    TR.Tr(GConsts.VALUETYPE_TIME),
Severity: Major
Found in src/NSWallet/NSWallet/Helpers/Labels/LabelsManagement.cs and 1 other location - About 1 hr to fix
src/NSWallet/NSWallet/Views/LabelScreen/LabelScreenView.cs on lines 126..135

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

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

            for (int i = 0; i < FlowItemsSource.Count; i++)
            {
                if (i % colCount == 0)
                {
                    position++;
Severity: Major
Found in src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs and 1 other location - About 1 hr to fix
src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs on lines 565..578

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

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

                        for (int i = 0; i < gr.Count; i++)
                        {
                            if (i % colCount == 0)
                            {
                                position++;
Severity: Major
Found in src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs and 1 other location - About 1 hr to fix
src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.cs on lines 512..527

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

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

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

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

          Method ExecuteRestoreBackupCommand has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
          Open

                  protected void ExecuteRestoreBackupCommand(object sender)
                  {
                      try {
                          var backup = (BackupModel)((ListView)sender).SelectedItem;
          
          

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

                  static void EnumerateItems(string id, bool recursive = false)
                  {
                      try {
                          foreach (var item in BL.GetListByParentID(id, true)) {
                              if (!recursive)
          Severity: Minor
          Found in src/NSWallet/Droid/Interfaces/ExportService.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 EnumerateItems has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
          Open

                  static void EnumerateItems(string id, bool recursive = false)
                  {
                      try {
                          foreach (var item in BL.GetListByParentID(id, true)) {
                              if (!recursive)
          Severity: Minor
          Found in src/NSWallet/NSWallet.Mac/Interfaces/ExportService.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

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

                  public TableQuery<nswallet_fields> RetrieveAllFields()
                  {
                      try
                      {
                          CheckConnection();
          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 679..691

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

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

                  static void EnumerateItems(string id, bool recursive = false)
                  {
                      try {
                          foreach (var item in BL.GetListByParentID(id, true)) {
                              if (!recursive)
          Severity: Minor
          Found in src/NSWallet/iOS/Interfaces/ExportService.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

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

                  public TableQuery<nswallet_items> RetrieveAllItems()
                  {
                      try
                      {
                          CheckConnection();
          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 693..705

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

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

                  protected void ExecuteRestoreBackupCommand(object sender)
                  {
                      try {
                          var backup = (BackupModel)((ListView)sender).SelectedItem;
          
          

            Method wasNonConsumableItemPurchased has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Method SetLanguage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public static void SetLanguage(string langCode)
                      {
                          if (string.IsNullOrEmpty(RunNameSpace))
                          {
                              throw new LocalizationException("Namespace is not set");
              Severity: Minor
              Found in src/NSWallet/NSWallet.Shared/Localization/Translations.cs - About 1 hr to fix

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

                            var appVersion = new Label {
                                Text = String.Format("{0}: {1}", TR.Tr("version_label"), PlatformSpecific.GetVersion()),
                                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 81..88
                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 appVersion = new Label {
                                Text = String.Format("{0}: {1}", TR.Tr("version_label"), PlatformSpecific.GetVersion()),
                                FontSize = FontSizeController.GetSize(NamedSize.Small, typeof(Label)),
                                FontFamily = NSWFontsController.CurrentBoldTypeface,
                                HorizontalTextAlignment = TextAlignment.Start,
                Severity: Major
                Found in src/NSWallet/NSWallet/Views/AboutScreen/AboutScreenView.cs and 4 other locations - About 1 hr to fix
                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
                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 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/AboutScreen/AboutScreenView.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/AdminScreen/AdminScreenView.cs on lines 72..79
                src/NSWallet/NSWallet/Views/AdminScreen/AdminScreenView.cs on lines 81..88
                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

                Severity
                Category
                Status
                Source
                Language