What kind of roof flashing is this and is it up to code?
I can tell you it is inappropriate and must have been installed by someone that doesn’t understand flashing and counter flashing principles. 

The Code is clear, “The exterior walls shall provide a weather resistant wall envelope, ...including flashing.” (See ICC R703.1) 

The flashing should have been “step flashing”, as specified by the Code: “Approved corrosion resistant flashing shall be installed SHINGLE FASHION in a manner to prevent entry of water...” (ICC R703.4) That is a continuous flashing not step flashing in a shingle fashion. If they don’t understand how it’s done, they can see an illustration at Figure R703.4.1.

In addition, the step flashing should have a “kickout” as shown in Figure R703.4.1

That flashing creates a  space for water to get trapped and could backup into the wall/roof. It needs to be removed and replaced with step flashing.