I find the test confusing, interpreting it as "count the found YCP modules". IMHO this would be more readable:

    [find ... | grep ... && has_ycp_modules=1]
    test -n "$has_ycp_modules"`