virtual-labs-archive / physical-chemistry-iiith

Other
1 stars 64 forks source link

Expected { after 'if' condition. (curly) #42

Open BSravanthi opened 5 years ago

BSravanthi commented 5 years ago

JavaScript allows the omission of curly braces when a block contains only one statement. However, it is considered by many to be the best practice to never omit curly braces around blocks, even when they are optional because it can lead to bugs and reduces code clarity. So the following:

//Bad
if (foo) foo++;

Can be rewritten as:

//Good
if (foo) {
    foo++;
}

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

Khwaja-Bilkhis commented 5 years ago

commit id: 12bde33 commit id: 18a9a3d

Khwaja-Bilkhis commented 5 years ago

commit id: ebcb7f2 commit id: 751ef0e commit id: 77ef511

snehitharangu commented 5 years ago

Valid fix @Khwaja-Bilkhis

VINEETHREDDYSHERI commented 5 years ago

Valid fix @Khwaja-Bilkhis

ShivaniKomandury commented 5 years ago

Valid Fix @Khwaja-Bilkhis

thecoderxman commented 5 years ago

Validated @Khwaja-Bilkhis