Examples of errors detected by the V3066 diagnostic


V3066. Possible incorrect order of arguments passed to method.


FlashDevelop

V3066 Possible incorrect order of arguments passed to '_channelMixer_OVERLAY' method: 'back' and 'fore'. BBCodeStyle.cs 302


static float _channelMixer_OVERLAY(float back, float fore)
{
  ....
}

private static float _channelMixer_HARDLIGHT(float back,
  float fore)
{
  return _channelMixer_OVERLAY(fore, back);
}

Media Portal 2

V3066 Possible incorrect order of arguments passed to 'TryCreateMultimediaCDDriveHandler' method. RemovableMediaManager.cs 109


public static MultimediaDriveHandler
TryCreateMultimediaCDDriveHandler(DriveInfo driveInfo,
  IEnumerable<Guid> videoMIATypeIds,
  IEnumerable<Guid> imageMIATypeIds, // <=
  IEnumerable<Guid> audioMIATypeIds) // <=
  { .... }

protected void ExamineVolume(string drive)
{
  ....
  MultimediaDriveHandler.TryCreateMultimediaCDDriveHandler(
    driveInfo,
    Consts.NECESSARY_VIDEO_MIAS,
    Consts.NECESSARY_AUDIO_MIAS, // <=
    Consts.NECESSARY_IMAGE_MIAS) // <=
  ....
}

'NECESSARY_AUDIO_MIAS' and 'NECESSARY_IMAGE_MIAS' has incorrect order passed to 'TryCreateMultimediaCDDriveHandler' method.


.NET Core Libraries (CoreFX)

V3066 Possible incorrect order of arguments passed to 'SerializationHeaderRecord' constructor: 'minorVersion' and 'majorVersion'. BinaryFormatterWriter.cs 111


internal void WriteSerializationHeader(
  int topId,
  int headerId,
  int minorVersion,
  int majorVersion)
{
  var record = new SerializationHeaderRecord(
                     BinaryHeaderEnum.SerializedStreamHeader,
                     topId,
                     headerId,
                     minorVersion,  // <=
                     majorVersion); // <=
  record.Write(this);
}

internal SerializationHeaderRecord(
  BinaryHeaderEnum binaryHeaderEnum,
  int topId,
  int headerId,
  int majorVersion, // <=
  int minorVersion) // <=
{
  _binaryHeaderEnum = binaryHeaderEnum;
  _topId = topId;
  _headerId = headerId;
  _majorVersion = majorVersion;
  _minorVersion = minorVersion;
}

Azure PowerShell

V3066 Possible incorrect order of arguments passed to 'PersistSyncServerRegistration' method: 'storageSyncServiceUid' and 'discoveryUri'. EcsManagementInteropClient.cs 364


public class EcsManagementInteropClient : IEcsManagement
{
  ....
  public int PersistSyncServerRegistration(....)
  {
    return m_managementObject.PersistSyncServerRegistration(
      serviceUri,
      subscriptionId,
      storageSyncServiceName,
      resourceGroupName,
      clusterId,
      clusterName,
      storageSyncServiceUid,  // <=
      discoveryUri,           // <=
      serviceLocation,
      resourceLocation);
  }
  ....
}

public interface IEcsManagement : IDisposable
{
  ....
  int PersistSyncServerRegistration(
    [In, MarshalAs(UnmanagedType.BStr)]
    string serviceUri,
    [In, MarshalAs(UnmanagedType.BStr)]
    string subscriptionId,
    [In, MarshalAs(UnmanagedType.BStr)]
    string storageSyncServiceName,
    [In, MarshalAs(UnmanagedType.BStr)]
    string resourceGroupName,
    [In, MarshalAs(UnmanagedType.BStr)]
    string clusterId,
    [In, MarshalAs(UnmanagedType.BStr)]
    string clusterName,
    [In, MarshalAs(UnmanagedType.BStr)]
    string discoveryUri,                  // <=
    [In, MarshalAs(UnmanagedType.BStr)]
    string storageSyncServiceUid,         // <=
    [In, MarshalAs(UnmanagedType.BStr)]
    string serviceLocation,
    [In, MarshalAs(UnmanagedType.BStr)]
    string resourceLocation);
  ....
}

Telerik UI for UWP

V3066 Possible incorrect order of arguments passed to 'NotifyCollectionChangedEventArgs' constructor: 'oldItem' and 'newItem'. CheckedItemsCollection.cs 470


public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action,
                                        object newItem, // <=
                                        object oldItem, // <=
                                        int index);

public class CheckedItemsCollection<T> : IList<T>, INotifyCollectionChanged
{
  ....
  private NotifyCollectionChangedEventArgs GenerateArgs(....)
  {
    switch (action)
    {
      case NotifyCollectionChangedAction.Add:
        ....

      case NotifyCollectionChangedAction.Remove:
        ....

      case NotifyCollectionChangedAction.Replace:
        return new NotifyCollectionChangedEventArgs(action,
                                                    oldItem, // <=
                                                    newItem, // <=
                                                    changeIndex);

      default:
        return new NotifyCollectionChangedEventArgs(action);
    }
  }
}

OpenCvSharp

V3066 Possible incorrect order of arguments passed to 'calib3d_Rodrigues_MatToVec' method: 'matrixM.CvPtr' and 'vectorM.CvPtr'. Cv2_calib3d.cs 86


public static void Rodrigues(double[,] matrix, out double[] vector,
  out double[,] jacobian)
{
  ....
  using (var jacobianM = new Mat<double>())
  {
    NativeMethods.calib3d_Rodrigues_MatToVec
      (matrixM.CvPtr, vectorM.CvPtr,
       jacobianM.CvPtr);
    ....
  }
}

public static extern void calib3d_Rodrigues_MatToVec(
  IntPtr vector, IntPtr matrix, IntPtr jacobian)


Bugs Found

Checked Projects
363
Collected Errors
13 495