-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added carbon impact of cloud providers #58
Conversation
@@ -46,6 +46,53 @@ const correctData = [ | |||
}, | |||
]; | |||
|
|||
const correctDataWithOptionals = [ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
}, | ||
], | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -74,55 +121,25 @@ const incorrectData = [ | |||
}, | |||
]; | |||
|
|||
test("Validate JSON file (URL) and return list of cloud providers and instances", async () => { | |||
test("Validate JSON file without optional values against the schema", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
}); | ||
|
||
|
||
test("Validate JSON file with optional parameters against the schema", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -17,7 +17,7 @@ const habitatData = [ | |||
["RTX4000", 20.2342], | |||
]; | |||
|
|||
const correctData = [ | |||
const correctDataWithoutOptionals = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
Please do a demo of this on Thursday! |
@@ -1,3 +1,28 @@ | |||
const GPU_POWER = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File utils.js
has 266 lines of code (exceeds 250 allowed). Consider refactoring.
return (GPU_POWER.MAX_WATTS[gpuName] - GPU_POWER.MIN_WATTS[gpuName]) * 0.5 + GPU_POWER.MIN_WATTS[gpuName]; | ||
} | ||
|
||
export function getCarbonDataOfInstance(time, instance, cloudProvider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function getCarbonDataOfInstance
has 26 lines of code (exceeds 25 allowed). Consider refactoring.
<div className="innpv-subpanel-content"> | ||
<Container fluid> | ||
<ResponsiveContainer width="100%" height={50*carbonData.length}> | ||
<BarChart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
@@ -1,3 +1,28 @@ | |||
const GPU_POWER = { | |||
MIN_WATTS: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
"p4": 9, | ||
"p100": 36 | ||
}, | ||
MAX_WATTS: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit d3cc916 and detected 13 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Changes made:
Screenshot of changes: