Skip to content
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

v1 of Predictive modeling page #98

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

MattG57
Copy link
Collaborator

@MattG57 MattG57 commented Dec 26, 2024

The fields, calculations and tool tips are in place....needs formatting an connection to the database.

Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

private makeEventListenersPassive() {
const elements = document.querySelectorAll('.highcharts-container');
elements.forEach(element => {
element.addEventListener('touchstart', () => {}, { passive: true });

Check failure

Code scanning / ESLint

Disallow empty functions Error

Unexpected empty arrow function.

Copilot Autofix AI 3 days ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

console.log('6. Updated gridObject from form:', this.gridObject);
}

private convertMetricStateToString(metricState: MetricState): { [key: string]: string } {

Check failure

Code scanning / ESLint

Require or disallow the `Record` type Error

A record is preferred over an index signature.
}

private convertMetricStateToString(metricState: MetricState): { [key: string]: string } {
const result: { [key: string]: string } = {};

Check failure

Code scanning / ESLint

Require or disallow the `Record` type Error

A record is preferred over an index signature.
private convertMetricStateToString(metricState: MetricState): { [key: string]: string } {
const result: { [key: string]: string } = {};
for (const key in metricState) {
if (metricState.hasOwnProperty(key)) {

Check failure

Code scanning / ESLint

Disallow calling some `Object.prototype` methods directly on objects Error

Do not access Object.prototype method 'hasOwnProperty' from target object.

Copilot Autofix AI 3 days ago

To fix the problem, we should avoid calling hasOwnProperty directly on the object. Instead, we can use Object.prototype.hasOwnProperty.call to safely check if the property exists on the object. This approach ensures that we are always calling the method from Object.prototype, avoiding any potential issues with shadowing.

We need to update the line where hasOwnProperty is called directly on the object and replace it with Object.prototype.hasOwnProperty.call.

Suggested changeset 1
frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts b/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts
--- a/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts
+++ b/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts
@@ -247,3 +247,3 @@
     for (const key in metricState) {
-      if (metricState.hasOwnProperty(key)) {
+      if (Object.prototype.hasOwnProperty.call(metricState, key)) {
         result[key] = this.decimalPipe.transform(metricState[key], '1.0-0') || '0';
EOF
@@ -247,3 +247,3 @@
for (const key in metricState) {
if (metricState.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(metricState, key)) {
result[key] = this.decimalPipe.transform(metricState[key], '1.0-0') || '0';
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
return result;
}

private convertMetricStateToNumber(metricState: { [key: string]: string }): MetricState {

Check failure

Code scanning / ESLint

Require or disallow the `Record` type Error

A record is preferred over an index signature.
productivityBoost: 0
};
for (const key in metricState) {
if (metricState.hasOwnProperty(key)) {

Check failure

Code scanning / ESLint

Disallow calling some `Object.prototype` methods directly on objects Error

Do not access Object.prototype method 'hasOwnProperty' from target object.

Copilot Autofix AI 3 days ago

To fix the problem, we should avoid directly calling Object.prototype.hasOwnProperty on the object. Instead, we can use Object.prototype.hasOwnProperty.call to safely check if the object has the specified property. This approach ensures that we are calling the method from Object.prototype and not from the object itself, thus avoiding any potential issues with overridden properties.

We need to update the code in the convertMetricStateToString and convertMetricStateToNumber methods to use Object.prototype.hasOwnProperty.call instead of directly calling hasOwnProperty.

Suggested changeset 1
frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts b/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts
--- a/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts
+++ b/frontend/src/app/main/copilot/value-modeling/value-modeling.component.ts
@@ -247,3 +247,3 @@
     for (const key in metricState) {
-      if (metricState.hasOwnProperty(key)) {
+      if (Object.prototype.hasOwnProperty.call(metricState, key)) {
         result[key] = this.decimalPipe.transform(metricState[key], '1.0-0') || '0';
@@ -272,3 +272,3 @@
     for (const key in metricState) {
-      if (metricState.hasOwnProperty(key)) {
+      if (Object.prototype.hasOwnProperty.call(metricState, key)) {
         const value = parseFloat(metricState[key].replace(/,/g, '').replace(/[^0-9.-]+/g, ''));
EOF
@@ -247,3 +247,3 @@
for (const key in metricState) {
if (metricState.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(metricState, key)) {
result[key] = this.decimalPipe.transform(metricState[key], '1.0-0') || '0';
@@ -272,3 +272,3 @@
for (const key in metricState) {
if (metricState.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(metricState, key)) {
const value = parseFloat(metricState[key].replace(/,/g, '').replace(/[^0-9.-]+/g, ''));
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
import { Directive, ElementRef, HostListener } from '@angular/core';

@Directive({
selector: '[matThousandSeparator]'

Check failure

Code scanning / ESLint

Directive selectors should follow given naming rules. See more at https://angular.dev/style-guide#style-02-06 and https://angular.dev/style-guide#style-02-08. Error

The selector should start with one of these prefixes: "app" (https://angular.dev/style-guide#style-02-08)
selector: '[matThousandSeparator]'
})
export class ThousandSeparatorDirective {
private regex: RegExp = new RegExp(/^\d+$/);

Check failure

Code scanning / ESLint

Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean Error

Type RegExp trivially inferred from a RegExp literal, remove type annotation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant