ome / bioformats

Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the Open Microscopy Environment. Bio-Formats is released under the GNU General Public License (GPL); commercial licenses are available from Glencoe Software.
https://www.openmicroscopy.org/bio-formats
GNU General Public License v2.0
371 stars 241 forks source link

Repeated conditional tests #4143

Closed scuniff closed 3 months ago

scuniff commented 5 months ago

https://github.com/ome/bioformats/blob/077ed120c9884af6f8cd7932e4156ac910d471b4/components/formats-bsd/src/loci/formats/out/DicomWriter.java#L1869

DimensionOrder order = retrieve.getPixelsDimensionOrder(series);
return sequential && (sizeC == 1 || sizeZ == 1 ||
  order == DimensionOrder.XYZCT ||
  order == DimensionOrder.XYZTC ||
  order == DimensionOrder.XYZTC ||
  order == DimensionOrder.XYTZC);

}

Enum DimensionOrder.XYZTC is repeated, was another enum meant like DimensionOrder.XYTCZ ??

dgault commented 5 months ago

Hi @scuniff, thank you for opening the issue, it does indeed seem like the condition has mistakenly been repeated. Out of curiosity are you using some automated tooling to find these issues?

scuniff commented 5 months ago

Yes, I use SpotBugs

https://spotbugs.github.io/index.html

I use SpotBugs to find problems and to get myself familiar with the code so I can maybe get more involved. I’ve been using it lately on Bioformats, OMERO , and ImageJ