In the UK the relevant legislation is IR35 which was originally introduced to stop full timers leaving PAYE and arriving back after the weekend as a contractor. It was a sledgehammer to crack a nut at the time, expected to raise £200 million, a mere drop in the ocean. 10 years or so later the IR can't say how much has been raised but it is known to be a very small amount.
However, the downside is that it forced the perfectly legitimate self employed contractors into becoming part of a limited company and having to take income as dividends to lower the NI exposure. Then comes the acid test of whether you are just a disguised employee, therefore have to pay full NI - both employers and employees, and then PAYE. There is/was a paltry allowance of 5% for all expenses in running the ltd company, but it does not start to cover the extra NI and administration expenses. Also, as a ltd co contracting to another there is no employment protection- this has to be built into the ltd co, another unfairness.
The composite, or umbrella companies used to be able to offer total tax payments of under 20% but most of these schemes are now being closed down by the IR.