class CipherWithNoIntegrityDetector extends OpcodeStackDetector {

    private static final String ECB_MODE_TYPE = "ECB_MODE";
    private static final String PADDING_ORACLE_TYPE = "PADDING_ORACLE";
    private static final String CIPHER_INTEGRITY_TYPE = "CIPHER_INTEGRITY";

    private static final Pattern AUTHENTICATED_CIPHER_MODES = Pattern.compile(".*/(CCM|CWC|OCB|EAX|GCM(-SIV)?)/.*");
    private static final Pattern INSECURE_ECB_MODES = Pattern.compile("(AES|DES(ede)?)(/ECB/.*)?");

    private final BugReporter bugReporter;

    public CipherWithNoIntegrityDetector(BugReporter bugReporter) {
        this.bugReporter = bugReporter;
    }

    @Override
    public void sawOpcode(int seen) {<FILL_FUNCTION_BODY>}

    private void reportBug(String type) {
        bugReporter.reportBug(new BugInstance(this, type, Priorities.HIGH_PRIORITY)
                .addClass(this).addMethod(this).addSourceLine(this));
    }
}

        if ((seen != Const.INVOKESTATIC
                || !getClassConstantOperand().equals("javax/crypto/Cipher"))
                || !getNameConstantOperand().equals("getInstance")) {
            return;
        }
        OpcodeStack.Item item = stack.getStackItem(getSigConstantOperand().contains(";L") ? 1 : 0);
        String cipherValue;
        if (StackUtils.isConstantString(item)) {
            cipherValue = (String) item.getConstant();
        } else {
            return;
        }
        if (INSECURE_ECB_MODES.matcher(cipherValue).matches()) {
            reportBug(ECB_MODE_TYPE);
        }
        if (cipherValue.contains("/CBC/PKCS5Padding")) {
            reportBug(PADDING_ORACLE_TYPE);
        }

        //Some cipher will not have mode specified (ie: "RSA" .. issue GitHub #24)
        if (!AUTHENTICATED_CIPHER_MODES.matcher(cipherValue).matches()
                && !cipherValue.startsWith("RSA") && !cipherValue.equals("ECIES")  //Avoid non-block-cipher algo
                ) {
            reportBug(CIPHER_INTEGRITY_TYPE);
        }
    
<no_super_class>