CORE-POS/IS4C

View on GitHub
pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs

Summary

Maintainability
F
3 wks
Test Coverage

File SPH_SignAndPay_USB.cs has 1347 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.IO;
using System.IO.Ports;
using System.Threading;
using CustomForms;
Severity: Major
Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 3 days to fix

    Method HandleDeviceMessage has a Cognitive Complexity of 133 (exceeds 20 allowed). Consider refactoring.
    Open

        protected virtual void HandleDeviceMessage(byte[] msg){
            if (this.verbose_mode > 0)
                System.Console.Write("DMSG: {0}: ",current_state);
    
            if (msg == null) msg = new byte[0];
    Severity: Minor
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 days 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

    Class SPH_SignAndPay_USB has 57 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class SPH_SignAndPay_USB : SerialPortHandler {
    
        protected static String MAGELLAN_OUTPUT_DIR = "ss-output/";
    
        protected USBWrapper usb_port;
    Severity: Major
    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 day to fix

      Method HandleReadData has a Cognitive Complexity of 67 (exceeds 20 allowed). Consider refactoring.
      Open

          protected void HandleReadData(byte[] input){
              int msg_sum = 0;
              if (usb_report_size == 64){
                  byte[] temp_in = new byte[65];
                  temp_in[0] = 0;
      Severity: Minor
      Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 day 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 HandleDeviceMessage has 138 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected virtual void HandleDeviceMessage(byte[] msg){
              if (this.verbose_mode > 0)
                  System.Console.Write("DMSG: {0}: ",current_state);
      
              if (msg == null) msg = new byte[0];
      Severity: Major
      Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 5 hrs to fix

        Method SendReport has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
        Open

            protected void SendReport(byte[] data){
                if (this.verbose_mode > 0){
                    System.Console.WriteLine("Full Report "+data.Length);
                    for(int j=0;j<data.Length;j++){
                        if (j % 16 == 0 && j > 0)
        Severity: Minor
        Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 4 hrs 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 PinpadGetPIN has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected byte[] PinpadGetPIN(){
                byte[] ret = new byte[112];
                int pos = 0;
        
                // Command head
        Severity: Major
        Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 3 hrs to fix

          Method HandleReadData has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected void HandleReadData(byte[] input){
                  int msg_sum = 0;
                  if (usb_report_size == 64){
                      byte[] temp_in = new byte[65];
                      temp_in[0] = 0;
          Severity: Major
          Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 3 hrs to fix

            Method ManualEntryPAN has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected byte[] ManualEntryPAN(){
                    byte[] ret = new byte[68];
            
                    int pos = 0;
                    ret[pos++] = 0x75;
            Severity: Major
            Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 hrs to fix

              Method ManualEntryExp has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected byte[] ManualEntryExp(){
                      byte[] ret = new byte[70];
              
                      int pos = 0;
                      ret[pos++] = 0x75;
              Severity: Major
              Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 hrs to fix

                Method ManualEntryCVV has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected byte[] ManualEntryCVV(){
                        byte[] ret = new byte[75];
                
                        int pos = 0;
                        ret[pos++] = 0x75;
                Severity: Major
                Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 hrs to fix

                  Method HandleMsg has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public override void HandleMsg(string msg){ 
                  
                          // optional predicate for "termSig" message
                          // predicate string is displayed on sig capture screen
                          if (msg.Length > 7 && msg.Substring(0, 7) == "termSig") {
                  Severity: Major
                  Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 2 hrs to fix

                    Method SendReport has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected void SendReport(byte[] data){
                            if (this.verbose_mode > 0){
                                System.Console.WriteLine("Full Report "+data.Length);
                                for(int j=0;j<data.Length;j++){
                                    if (j % 16 == 0 && j > 0)
                    Severity: Minor
                    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 hr to fix

                      Method LcdCreateColoredButton has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected byte[] LcdCreateColoredButton(int id, string label, int x_top_left, int y_top_left,
                                  int x_bottom_right, int y_bottom_right, byte[] foreground, byte[] background){
                      
                              byte[] ret = new byte[33 + label.Length];
                      
                      
                      Severity: Minor
                      Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 hr to fix

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

                            protected byte[] LcdStoreImage(int image_id, string file_name) {
                                string ext;
                                int type = 0;
                                try {
                                    ext = Path.GetExtension(file_name);
                        Severity: Minor
                        Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 hr to fix

                          Method RebootTerminal has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected virtual void RebootTerminal()
                              {
                                  try {
                                      SendReport(BuildCommand(ResetDevice()));
                                  }
                          Severity: Minor
                          Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 hr to fix

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

                                protected byte[] BuildCommand(byte[] data){
                                    int size = data.Length + 6;
                                    if (data.Length > 0x8000) size++;
                            
                                    byte[] cmd = new byte[size];
                            Severity: Minor
                            Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 hr to fix

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

                                  protected byte[] LcdCreateColoredButton(int id, string label, int x_top_left, int y_top_left,
                                          int x_bottom_right, int y_bottom_right, byte[] foreground, byte[] background){
                              Severity: Major
                              Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 1 hr to fix

                                Method LcdCreateButton has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    protected byte[] LcdCreateButton(int id, string label, int x_top_left, int y_top_left,
                                            int x_bottom_right, int y_bottom_right){
                                Severity: Minor
                                Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 45 mins to fix

                                  Method LcdSetClipArea has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      protected byte[] LcdSetClipArea(int x_top_left, int y_top_left, int x_bottom_right, int y_bottom_right, bool border, byte[] rgb){
                                  Severity: Minor
                                  Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if (j % 16 == 0 && j > 0)
                                                                System.Console.WriteLine("");
                                    Severity: Major
                                    Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 45 mins to fix

                                      Method LcdShowImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          protected byte[] LcdShowImage(int image_id, int x_top_left, int y_top_left, int x_bottom_right, int y_bottom_right){
                                      Severity: Minor
                                      Found in pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs - About 35 mins to fix

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

                                            protected byte[] ManualEntryCVV(){
                                                byte[] ret = new byte[75];
                                        
                                                int pos = 0;
                                                ret[pos++] = 0x75;
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1524..1617
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1619..1712

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

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

                                            protected byte[] ManualEntryExp(){
                                                byte[] ret = new byte[70];
                                        
                                                int pos = 0;
                                                ret[pos++] = 0x75;
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1524..1617
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1714..1807

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

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

                                            protected byte[] ManualEntryPAN(){
                                                byte[] ret = new byte[68];
                                        
                                                int pos = 0;
                                                ret[pos++] = 0x75;
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1619..1712
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1714..1807

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

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

                                            protected virtual void RebootTerminal()
                                            {
                                                try {
                                                    SendReport(BuildCommand(ResetDevice()));
                                                }
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 100..137
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Native.cs on lines 100..137

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

                                        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

                                                case STATE_GET_SIGNATURE:
                                                    if (msg.Length == 4 && msg[0] == 0x7a){
                                                        //SendReport(BuildCommand(DoBeep()));
                                                        if (msg[1] == BUTTON_SIG_RESET){
                                                            SendReport(BuildCommand(LcdClearSignature()));
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 240..255

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

                                        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

                                                if (this.verbose_mode > 1){
                                                    System.Console.WriteLine("");
                                                    System.Console.WriteLine("IN BYTES:");
                                                    for(int i=0;i<input.Length;i++){
                                                        if (i>0 && i %16==0) System.Console.WriteLine("");
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_IngenicoRBA_USB.cs on lines 221..230

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

                                        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

                                            protected byte[] LcdTextBackgroundColor(int red, int green, int blue){
                                                byte[] ret = new byte[6];
                                        
                                                // Command head
                                                ret[0] = 0x8a;
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1008..1021

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

                                        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

                                            protected byte[] LcdTextColor(int red, int green, int blue){
                                                byte[] ret = new byte[6];
                                        
                                                // Command head
                                                ret[0] = 0x8a;
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 1023..1036

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

                                        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

                                                        if (this.verbose_mode > 1){
                                                            for(int j=0;j<usb_report_size;j++){
                                                                if (j % 16 == 0 && j > 0)
                                                                    System.Console.WriteLine("");
                                                                System.Console.Write("{0:x} ", report[j]);
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 958..966

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

                                        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

                                                if (this.verbose_mode > 1){
                                                    for(int i=0;i<usb_report_size;i++){
                                                        if (i % 16 == 0 && i > 0)
                                                            System.Console.WriteLine("");
                                                        System.Console.Write("{0:x} ", report[i]);
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 937..945

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

                                        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

                                                case STATE_MANUAL_EXP:
                                                    if (msg.Length == 1 && msg[0] == 0x6){
                                                        ack_counter++;
                                                        if (this.verbose_mode > 0)
                                                            System.Console.WriteLine(ack_counter);
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 256..267
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 268..279
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 655..666

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

                                        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

                                                case STATE_MANUAL_PAN:
                                                    if (msg.Length == 1 && msg[0] == 0x6){
                                                        ack_counter++;
                                                        if (this.verbose_mode > 0)
                                                            System.Console.WriteLine(ack_counter);
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 256..267
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 268..279
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 667..678

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

                                        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

                                                case STATE_MANUAL_CVV:
                                                    if (msg.Length > 63 && msg[0] == 0x80){
                                                        string block = FixupCardBlock(msg);
                                                        PushOutput("PANCACHE:"+block);
                                                        SetStateCardType();
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 280..290

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

                                        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

                                                        else if (msg[1] == BUTTON_GIFT){
                                                            PushOutput("TERM:Gift");
                                                        }
                                                        else if (msg[1] == BUTTON_HARDWARE_BUTTON && msg[3] == 0x43){
                                                            SetStateStart();
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 598..604

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

                                        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

                                                        else if (msg[1] == BUTTON_EBT_CASH){
                                                            PushOutput("TERM:EbtCash");
                                                        }
                                                        else if (msg[1] == BUTTON_HARDWARE_BUTTON && msg[3] == 0x43){
                                                            SetStateStart();
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 583..589

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

                                        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

                                                SendReport(BuildCommand(LcdCreateColoredButton(BUTTON_SIG_ACCEPT,"Done",5,28,115,73, new byte[]{0x0,0x0,0x0}, new byte[]{0x0,0xbb,0x0})));
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 243..243
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 245..245
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 248..248
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 352..352

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

                                        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

                                                SendReport(BuildCommand(LcdCreateColoredButton(BUTTON_DEBIT,"Debit",174,144,314,234, new byte[]{0x0,0x0,0x0}, new byte[]{0xee,0x0,0x0})));
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 243..243
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 248..248
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 352..352
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 353..353

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

                                        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

                                                SendReport(BuildCommand(LcdCreateColoredButton(BUTTON_CREDIT,"Credit",5,5,145,95, new byte[]{0x0,0x0,0x0}, new byte[]{0x0,0xbb,0x0})));
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 245..245
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 248..248
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 352..352
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 353..353

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

                                        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

                                                SendReport(BuildCommand(LcdCreateColoredButton(BUTTON_SIG_RESET,"Clear",204,28,314,73, new byte[]{0x0,0x0,0x0}, new byte[]{0xee,0x0,0x0})));
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 243..243
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 245..245
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 248..248
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 353..353

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

                                        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

                                                    SendReport(BuildCommand(LcdCreateColoredButton(BUTTON_EBT,"EBT",5,144,145,234, new byte[]{0x0,0x0,0x0}, new byte[]{0xbb,0xbb,0x0})));
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 243..243
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 245..245
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 352..352
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 353..353

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

                                        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

                                                    else if (msg.Length > 1){
                                                        if (this.verbose_mode > 0)
                                                            System.Console.WriteLine(msg.Length+" "+msg[0]+" "+msg[1]);
                                                    }
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_Auto.cs on lines 304..307

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

                                        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

                                                        if (this.verbose_mode > 0){
                                                            System.Console.Write("Big Msg: ");
                                                            foreach(byte b in long_buffer)
                                                                System.Console.Write((char)b);
                                                            System.Console.WriteLine("");
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 473..478

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

                                        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

                                                    if (this.verbose_mode > 1){
                                                        System.Console.Write("Received: ");
                                                        foreach(byte b in data)
                                                            System.Console.Write((char)b);
                                                        System.Console.WriteLine("");
                                        pos/is4c-nf/scale-drivers/drivers/NewMagellan/SPH_SignAndPay_USB.cs on lines 493..498

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

                                        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

                                        There are no issues that match your filters.

                                        Category
                                        Status