CORE-POS/IS4C

View on GitHub
pos/is4c-nf/scale-drivers/drivers/NewMagellan/HidSharp/Platform/Windows/NativeMethods.cs

Summary

Maintainability
D
1 day
Test Coverage

Class NativeMethods has 35 methods (exceeds 20 allowed). Consider refactoring.
Open

    unsafe static class NativeMethods
    {
        // For constants, see PInvoke.Net,
        //  http://doxygen.reactos.org/de/d2a/hidclass_8h_source.html
        //  http://www.rpi.edu/dept/cis/software/g77-mingw32/include/winioctl.h

    File NativeMethods.cs has 323 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using System;
    using System.ComponentModel;
    using System.IO;
    using System.Reflection;
    using System.Runtime.InteropServices;

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

              public unsafe static void OverlappedOperation(IntPtr ioHandle,
                  IntPtr eventHandle, int eventTimeout, IntPtr closeEventHandle,
                  bool overlapResult,
                  NativeOverlapped* overlapped, out uint bytesTransferred)
              {

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

                public unsafe static extern bool DeviceIoControl(IntPtr handle,
                    uint ioControlCode, byte* inBuffer, uint inBufferSize, byte* outBuffer, uint outBufferSize,
                    IntPtr bytesReturned, NativeOverlapped* overlapped);

          Method CreateFile has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  public static extern IntPtr CreateFile(string filename, EFileAccess desiredAccess, EFileShare shareMode, IntPtr securityAttributes,
                      ECreationDisposition creationDisposition, EFileAttributes attributes, IntPtr template);

            Method OverlappedOperation has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    public unsafe static void OverlappedOperation(IntPtr ioHandle,
                        IntPtr eventHandle, int eventTimeout, IntPtr closeEventHandle,
                        bool overlapResult,
                        NativeOverlapped* overlapped, out uint bytesTransferred)

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

                      public static extern bool SetupDiGetDeviceInterfaceDetail(HDEVINFO deviceInfoSet,
                          ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData,
                          ref SP_DEVICE_INTERFACE_DETAIL_DATA deviceInterfaceDetailData,
                          int deviceInterfaceDetailDataSize, IntPtr requiredSize, IntPtr deviceInfoData);

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

                        public unsafe static extern bool WriteFile(IntPtr handle, byte* buffer, int bytesToWrite,
                            IntPtr bytesWritten, NativeOverlapped* overlapped);

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

                          public unsafe static extern bool ReadFile(IntPtr handle, byte* buffer, int bytesToRead,
                              IntPtr bytesRead, NativeOverlapped* overlapped);

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

                            public static extern bool SetupDiEnumDeviceInterfaces(HDEVINFO deviceInfoSet, IntPtr deviceInfoData,
                                [MarshalAs(UnmanagedType.LPStruct)] Guid interfaceClassGuid, int memberIndex,
                                ref SP_DEVICE_INTERFACE_DATA deviceInterfaceData);

                      There are no issues that match your filters.

                      Category
                      Status