virtual-labs-archive / cryptography-iiith

Cryptography lab
Other
3 stars 70 forks source link

Function 'hex2b64' has a complexity of 5. (complexity) #83

Open BSravanthi opened 5 years ago

BSravanthi commented 5 years ago

Cyclomatic complexity measures the number of linearly independent paths through a program's source code. This rule allows setting a cyclomatic complexity threshold. This rule is aimed at reducing code complexity by capping the amount of cyclomatic complexity allowed in a program. As such, it will warn when the cyclomatic complexity crosses the configured threshold. The following patterns are considered problems

//Bad:
function a(x) {
    if (true) {
        return x; // 1st path
    } else if (false) {
        return x+1; // 2nd path
    } else {
        return 4; // 3rd path
    }
}
//Good:
function a(x) {
    if (true) {
        return x;
    } else {
        return 4;
    }
}

Please refer to the following link to fix similar issues. https://app.codacy.com/app/BSravanthi/cryptography-iiith/issues?&filters=W3siaWQiOiJMYW5ndWFnZSIsInZhbHVlcyI6W251bGxdfSx7ImlkIjoiQ2F0ZWdvcnkiLCJ2YWx1ZXMiOlsiRXJyb3IgUHJvbmUiXX0seyJpZCI6IkxldmVsIiwidmFsdWVzIjpbbnVsbF19LHsiaWQiOiJQYXR0ZXJuIiwidmFsdWVzIjpbMTU2Nl19LHsidmFsdWVzIjpbXX1d

yuvrajmakkena commented 5 years ago

https://github.com/yuvrajchowdary/cryptography-iiith/commit/f88bd503eaf11a258b68214421056b2438eca90e

https://github.com/yuvrajchowdary/cryptography-iiith/commit/197e9b0c9c9c11bbf2981648e034892062a2e82f

https://github.com/yuvrajchowdary/cryptography-iiith/commit/a880bbf91f5771cdbf6bfa472da3f68ef397cf5a

https://github.com/yuvrajchowdary/cryptography-iiith/commit/9bea965fd6ebd92989a8670938ee2abb081f4613

DevikaBoddu commented 5 years ago

Valid fix @yuvrajchowdary