NancyyKin / 361_swe

0 stars 0 forks source link

Inconsistent Conventions #3

Open Pavluck opened 1 month ago

Pavluck commented 1 month ago

for_Natasha/colorService.js

Inconsistent Conventions

function hexToHSL(hex) {
...
    if (max == min)
        h = s = 0; // If it's a gray color
...
}
function getSeason(hex) {
    let hue = hexToHSL(hex);

    if (hue <= 60 || (330 < hue && hue <= 360)) {
        return "Winter";
    } else if (60 < hue && hue <= 150) {
        return "Spring";
    } else if (150 < hue && hue <= 240) {
        return "Summer";
    } else if (240 < hue && hue <= 330) {
        return "Fall";
    }
}

The curly braces accompanying the "if" statements in this microservice are inconsistent. The "if" statement in one function is not encased in curly braces, while the "if" statement in the getSeason function does use curly braces for single-lined branching statements.

Suggestion: Follow a consistent style conventions throughout the code.

Pavluck commented 1 month ago

The microservice meets my requirements"