bioformats icon indicating copy to clipboard operation
bioformats copied to clipboard

Repeated conditional tests

Open scuniff opened this issue 1 year ago • 2 comments

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 ??

scuniff avatar Jan 15 '24 06:01 scuniff

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?

dgault avatar Jan 18 '24 13:01 dgault

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

scuniff avatar Jan 26 '24 16:01 scuniff