bykovme/nswallet

View on GitHub

Showing 488 of 488 total issues

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

        public static void CreateSampleItems()
        {
            var dal = DataAccessLayer.GetInstance();

            // Banking
Severity: Minor
Found in src/NSWallet/NSWallet.Shared/Business/BusinessLayer.cs - About 1 hr to fix

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

                var termsOfUseLabel = new Label
                {
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                    HorizontalTextAlignment = TextAlignment.Center,
    Severity: Major
    Found in src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs and 3 other locations - About 1 hr to fix
    src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs on lines 32..41
    src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs on lines 57..66
    src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs on lines 39..49

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

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

                var termsOfUseLabel = new Label {
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                    HorizontalTextAlignment = TextAlignment.Center,
                    Margin = new Thickness(15),
    Severity: Major
    Found in src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs and 3 other locations - About 1 hr to fix
    src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs on lines 32..41
    src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs on lines 39..49
    src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs on lines 66..76

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

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

                var privacyPolicyLabel = new Label
                {
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                    HorizontalTextAlignment = TextAlignment.Center,
    Severity: Major
    Found in src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs and 3 other locations - About 1 hr to fix
    src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs on lines 32..41
    src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs on lines 57..66
    src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs on lines 66..76

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

    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

    using System;
    using Foundation;
    using NSWallet.iOS;
    using Xamarin.Forms;
    
    
    Severity: Major
    Found in src/NSWallet/iOS/Interfaces/BuildInfo.cs and 1 other location - About 1 hr to fix
    src/NSWallet/NSWallet.Mac/Interfaces/BuildInfo.cs on lines 1..27

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

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

                var privacyPolicyLabel = new Label {
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                    HorizontalTextAlignment = TextAlignment.Center,
                    Margin = new Thickness(15),
    Severity: Major
    Found in src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs and 3 other locations - About 1 hr to fix
    src/NSWallet/NSWallet/Views/Feedback/FeedbackPageView.cs on lines 57..66
    src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs on lines 39..49
    src/NSWallet/NSWallet/Views/Premium/PremiumPageView.cs on lines 66..76

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

    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

    using System;
    using Foundation;
    using NSWallet.Mac;
    using Xamarin.Forms;
    
    
    Severity: Major
    Found in src/NSWallet/NSWallet.Mac/Interfaces/BuildInfo.cs and 1 other location - About 1 hr to fix
    src/NSWallet/iOS/Interfaces/BuildInfo.cs on lines 1..25

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

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

            protected void ExecuteSearchLaunchCommand()
            {
                if (!IsLocalClipboardActivated) {
    
                    SearchEntryShowHideCommandCallback.Invoke(false);
    Severity: Minor
    Found in src/NSWallet/NSWallet/ViewModel/MainScreen/MainScreenViewModel.cs - About 1 hr to fix

      Method ToBytes has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public static byte[] ToBytes(string input)
              {
                  if (string.IsNullOrEmpty(input)) {
                      return new byte[0];
                  }
      Severity: Minor
      Found in src/NSWallet/NSWallet/Helpers/2FA/Base32Encoding.cs - About 1 hr to fix

        Method delete has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                void delete(ItemModel item)
                {
                    bool isUsed = false;
                    var itemList = BL.GetAllItems();
                    var itemFromList = itemList.SingleOrDefault(
        Severity: Minor
        Found in src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs - About 1 hr to fix

          Method GetDataTemplates has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  private IList<DataTemplate> GetDataTemplates(IList container)
                  {
                      List<DataTemplate> templates = new List<DataTemplate>();
          
                      var flowTemplateSelector = _flowColumnTemplate as FlowTemplateSelector;

            Method searchByText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    List<ItemList> searchByText(string text)
                    {
                        var loweredText = text.ToLower();
                        var searchResult = new List<ItemList>();
                        foreach (var item in savedList) {
            Severity: Minor
            Found in src/NSWallet/NSWallet/ViewModel/Icons/IconScreenViewModel.cs - About 1 hr to fix

              Method searchByText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      List<ItemList> searchByText(string text)
                      {
                          var loweredText = text.ToLower();
                          var searchResult = new List<ItemList>();
                          foreach (var item in savedList) {

                Method AddColumnsToTablesUpgrade03 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        public bool AddColumnsToTablesUpgrade03()
                        {
                            try {
                                CheckConnection();
                                BeginTransaction();
                Severity: Minor
                Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDBupgrade03.cs - About 1 hr to fix

                  Method ShareFile has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public void ShareFile(string fileName, string extraText, string mimeType, string popupText, Action action)
                          {
                              Intent intentShareFile = new Intent(Intent.ActionSend);
                              File fileWithinMyDir = new File(fileName);
                  
                  
                  Severity: Minor
                  Found in src/NSWallet/Droid/Interfaces/SharingDroid.cs - About 1 hr to fix

                    Method DeleteItem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            public void DeleteItem(string itemID, string changeTimestamp)
                            {
                                try
                                {
                                    CheckConnection();
                    Severity: Minor
                    Found in src/NSWallet/NSWallet.Shared/Database/NSWalletDB.cs - About 1 hr to fix

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

                                  var buttonsLayout = new Grid
                                  {
                                      VerticalOptions = LayoutOptions.End,
                                      //Orientation = StackOrientation.Horizontal,
                                      RowDefinitions = {
                      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 82..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 97.

                      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

                                  var buttonsLayout = new Grid {
                                      VerticalOptions = LayoutOptions.End,
                                      RowDefinitions = {
                                          new RowDefinition {
                                              Height = new GridLength(1, GridUnitType.Star)
                      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 93..114

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

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

                              private void ReloadGroupedContainerList()
                              {
                                  var colCount = DesiredColumnCount;
                                  var flowGroupsList = new List<FlowGroup>(FlowItemsSource.Count);
                                  var groupDisplayPropertyName = (FlowGroupDisplayBinding as Binding)?.Path;
                      Severity: Minor
                      Found in src/NSWallet/NSWallet/Controls/FlowListView/FlowListView.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 ExecuteSaveFieldCommand has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
                      Open

                              protected void ExecuteSaveFieldCommand()
                              {
                                  try {
                                      string updText = null;
                      
                      

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language