]> source.dussan.org Git - sonarqube.git/commitdiff
Apply feedback for security reports (#503)
authorPascal Mugnier <pascal.mugnier@sonarsource.com>
Thu, 12 Jul 2018 09:39:46 +0000 (11:39 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 17 Jul 2018 18:21:26 +0000 (20:21 +0200)
server/sonar-docs/src/EmbedDocsSuggestions.json
server/sonar-docs/src/tooltips/security-reports/hotspot.md [deleted file]
server/sonar-docs/src/tooltips/security-reports/vulnerability.md [deleted file]
server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMenu.tsx
server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMenu-test.tsx.snap
server/sonar-web/src/main/js/app/styles/init/links.css
server/sonar-web/src/main/js/apps/securityReports/components/App.tsx
server/sonar-web/src/main/js/apps/securityReports/components/VulnerabilityList.tsx
server/sonar-web/src/main/js/apps/securityReports/components/__tests__/__snapshots__/VulnerabilityList-test.tsx.snap
server/sonar-web/src/main/js/apps/securityReports/style.css
server/sonar-web/src/main/js/helpers/standards.json

index 12d1258f9597c622c6925be8907b5cb0e495a7cb..d512919471cbefbe8b166002880d0a4e9ddbe682 100644 (file)
       "text": "Quality Profiles"
     }
   ],
+  "security_reports": [
+    {
+      "link": "/documentation/security-reports",
+      "text": "Security Reports"
+    }
+  ],
   "settings": [],
   "system_info": [],
   "user_groups": [
diff --git a/server/sonar-docs/src/tooltips/security-reports/hotspot.md b/server/sonar-docs/src/tooltips/security-reports/hotspot.md
deleted file mode 100644 (file)
index 6a18927..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Hotspots are uses of sensitive APIs or technologies which might create Vulnerabilities if misused. Hotspots don't necessarily indicate problems, only that the code should be reviewed.
diff --git a/server/sonar-docs/src/tooltips/security-reports/vulnerability.md b/server/sonar-docs/src/tooltips/security-reports/vulnerability.md
deleted file mode 100644 (file)
index fcd3e37..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Vulnerabilities are security weaknesses that could be exploited by attackers.
index ca3a9ce6f5f6006b5f24c92f62ae9b4f2f8f06e3..45c15f90b35786b2f77bf60b2a9694ff4c5a60e0 100644 (file)
@@ -191,6 +191,9 @@ export default class ComponentNavMenu extends React.PureComponent<Props> {
   }
 
   renderSecurityReports() {
+    if (this.props.component.qualifier === 'BRC' || this.props.component.qualifier === 'DIR') {
+      return null;
+    }
     const isActive = location.pathname.startsWith('/project/security_reports');
     return (
       <Dropdown overlay={this.renderSecurityReportsLink()} tagName="li">
index 40cbe0f76bb1bb43b55101f72952271c6d73cb81..d35a9a9e59effc17ceec2e12911cad08a9c029c7 100644 (file)
@@ -251,49 +251,6 @@ exports[`should work for all qualifiers 2`] = `
       issues.page
     </Link>
   </li>
-  <Dropdown
-    overlay={
-      <ul
-        className="menu"
-      >
-        <li>
-          <Link
-            activeClassName="active"
-            onlyActiveOnIndex={false}
-            style={Object {}}
-            to={
-              Object {
-                "pathname": "/project/security_reports/owasp_top_10",
-                "query": Object {
-                  "id": "foo",
-                },
-              }
-            }
-          >
-            security_reports.owaspTop10.page
-          </Link>
-        </li>
-        <li>
-          <Link
-            activeClassName="active"
-            onlyActiveOnIndex={false}
-            style={Object {}}
-            to={
-              Object {
-                "pathname": "/project/security_reports/sans_top_25",
-                "query": Object {
-                  "id": "foo",
-                },
-              }
-            }
-          >
-            security_reports.sansTop25.page
-          </Link>
-        </li>
-      </ul>
-    }
-    tagName="li"
-  />
   <li>
     <Link
       activeClassName="active"
index bcf268567d2dbd548991e73e2fe8aed7b5b649ec..bc4b5507a76bf31573dc8cd5baf4580970734812 100644 (file)
@@ -73,6 +73,15 @@ a:focus {
   border-bottom: none;
 }
 
+.link-checkbox.disabled {
+  cursor: not-allowed;
+}
+
+.link-checkbox.disabled label {
+  color: var(--secondFontColor);
+  cursor: not-allowed;
+}
+
 .link-checkbox:hover,
 .link-checkbox:active,
 .link-checkbox:focus {
index 90cce4b3fdcdd558b5ad617e2e78531a9cfaabad..0dbf8ffed55bc0367f1715b00955cd9eca5611eb 100755 (executable)
@@ -94,7 +94,14 @@ export default class App extends React.PureComponent<Props, State> {
     })
       .then(results => {
         if (this.mounted) {
-          const hasVulnerabilities = results.categories.some(item => item.vulnerabilities > 0);
+          const hasVulnerabilities = results.categories.some(
+            item =>
+              item.vulnerabilities +
+                item.openSecurityHotspots +
+                item.toReviewSecurityHotspots +
+                item.wontFixSecurityHotspots >
+              0
+          );
           this.setState({ hasVulnerabilities, findings: results.categories, loading: false });
         }
       })
index c2bc6b513049b9f35666bd2c8ca33d23f5e760c5..a1af8a0f8086aefb1e0b1531753df61689de4b0c 100755 (executable)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import * as classNames from 'classnames';
 import { Link } from 'react-router';
 import { translate } from '../../../helpers/l10n';
 import { SecurityHotspot, Component, BranchLike } from '../../../app/types';
@@ -33,6 +34,9 @@ import {
   renderCWECategory,
   Standards
 } from '../utils';
+import DetachIcon from '../../../components/icons-components/DetachIcon';
+import Tooltip from '../../../components/controls/Tooltip';
+import { getRatingTooltip } from '../../../helpers/measures';
 
 interface Props {
   branchLike?: BranchLike;
@@ -86,78 +90,108 @@ export default class VulnerabilityList extends React.PureComponent<Props, State>
           this.state.standards[type][category].description && (
             <HelpTooltip
               className="spacer-left"
-              overlay={this.state.standards[type][category].description}
+              overlay={this.renderOverlay(this.state.standards[type][category].description)}
             />
           )}
       </>
     );
   }
 
+  renderOverlay = (description: string | undefined) => {
+    return (
+      <>
+        <p>{description}</p>
+        <hr className="spacer-top spacer-bottom" />
+        {translate('learn_more')}:
+        <Link
+          className="spacer-left"
+          target="_blank"
+          to={{ pathname: '/documentation/security-reports' }}>
+          Security Reports
+        </Link>
+        <DetachIcon
+          className="little-spacer-left little-spacer-right vertical-baseline"
+          size={12}
+        />
+      </>
+    );
+  };
+
   renderFinding(finding: SecurityHotspot, isCWE?: boolean): React.ReactFragment {
     const { branchLike, component, type } = this.props;
     const params: { [name: string]: string | undefined } = {
       ...getBranchLikeQuery(branchLike),
       types: 'SECURITY_HOTSPOT'
     };
-    params[type] = finding.category || finding.cwe;
+    params[isCWE ? 'cwe' : type] = finding.cwe || finding.category;
 
     const subFindings =
       this.props.showCWE && finding.distribution
         ? finding.distribution.map(f => this.renderFinding(f, true))
         : null;
 
+    const title = getRatingTooltip('security_rating', finding.vulnerabilityRating || 1);
     return (
       <React.Fragment key={finding.category || finding.cwe}>
         <tr>
-          {isCWE && <td />}
-          <td className="nowrap" colSpan={isCWE ? 1 : 2}>
-            <div className="display-inline-flex-center">
-              {this.getName(finding, isCWE ? 'cwe' : type)}
-            </div>
+          <td className={classNames({ 'cwe-title-cell': isCWE })}>
+            {this.getName(finding, isCWE ? 'cwe' : type)}
           </td>
-          <td>
+          <td className="text-right">
             <div className="display-inline-flex-center">
               <Link
-                to={getComponentIssuesUrl(component.key, { ...params, types: 'VULNERABILITY' })}>
+                to={getComponentIssuesUrl(component.key, {
+                  ...params,
+                  types: 'VULNERABILITY',
+                  resolved: 'false'
+                })}>
                 {finding.vulnerabilities}
               </Link>
-              <Link
-                className="link-no-underline spacer-left"
-                to={getComponentIssuesUrl(component.key, { ...params, types: 'VULNERABILITY' })}>
-                <Rating value={finding.vulnerabilityRating || 1} />
-              </Link>
+              <Tooltip overlay={title}>
+                <Link
+                  className="link-no-underline spacer-left"
+                  to={getComponentIssuesUrl(component.key, {
+                    ...params,
+                    types: 'VULNERABILITY',
+                    resolved: 'false'
+                  })}>
+                  <Rating value={finding.vulnerabilityRating || 1} />
+                </Link>
+              </Tooltip>
             </div>
           </td>
-          <td>
+          <td className="text-right">
             <Link
               className="spacer-right"
               to={getComponentIssuesUrl(component.key, {
                 ...params,
                 types: 'SECURITY_HOTSPOT',
                 resolved: 'false',
-                statuses: 'OPEN'
+                statuses: 'OPEN,REOPENED'
               })}>
               {finding.openSecurityHotspots}
             </Link>
           </td>
-          <td>
+          <td className="text-right">
             <Link
               className="spacer-right"
               to={getComponentIssuesUrl(component.key, {
                 ...params,
                 types: 'SECURITY_HOTSPOT',
-                resolutions: 'FIXED'
+                resolutions: 'FIXED',
+                statuses: 'RESOLVED'
               })}>
               {finding.toReviewSecurityHotspots}
             </Link>
           </td>
-          <td>
+          <td className="text-right">
             <Link
               className="spacer-right"
               to={getComponentIssuesUrl(component.key, {
                 ...params,
                 types: 'SECURITY_HOTSPOT',
-                resolutions: 'WONTFIX'
+                resolutions: 'WONTFIX',
+                statuses: 'RESOLVED'
               })}>
               {finding.wontFixSecurityHotspots}
             </Link>
@@ -174,29 +208,31 @@ export default class VulnerabilityList extends React.PureComponent<Props, State>
         <table className="data zebra">
           <thead>
             <tr>
-              <th className="security-category-column" colSpan={2}>
+              <th className="security-category-column">
                 {translate('security_reports.list.categories')}
               </th>
               <th className="security-result-column">
                 <div className="display-inline-flex-center">
-                  <VulnerabilityIcon className="spacer-right" />{' '}
+                  <VulnerabilityIcon className="spacer-right" />
                   {translate('security_reports.list.vulnerabilities')}
                 </div>
               </th>
               <th colSpan={3}>
                 <div className="display-inline-flex-center">
-                  <SecurityHotspotIcon className="spacer-right" />{' '}
+                  <SecurityHotspotIcon className="spacer-right" />
                   {translate('security_reports.list.hotspots')}
                 </div>
               </th>
             </tr>
             <tr className="subheader">
-              <th colSpan={3} />
-              <th className="security-result-column">{translate('security_reports.line.open')}</th>
-              <th className="security-result-column">
+              <th colSpan={2} />
+              <th className="text-right security-result-column">
+                {translate('security_reports.line.open')}
+              </th>
+              <th className="text-right security-result-column">
                 {translate('security_reports.line.in_review')}
               </th>
-              <th className="security-result-column">
+              <th className="text-right security-result-column">
                 {translate('security_reports.line.wont_fix')}
               </th>
             </tr>
index 437b86a78dbdec8612be19e370b537bcab2884a1..cde2b7944a405c36781b2789f90c8e4be81a8b74 100644 (file)
@@ -11,7 +11,6 @@ exports[`renders 1`] = `
       <tr>
         <th
           className="security-category-column"
-          colSpan={2}
         >
           security_reports.list.categories
         </th>
@@ -24,7 +23,6 @@ exports[`renders 1`] = `
             <VulnerabilityIcon
               className="spacer-right"
             />
-             
             security_reports.list.vulnerabilities
           </div>
         </th>
@@ -37,7 +35,6 @@ exports[`renders 1`] = `
             <SecurityHotspotIcon
               className="spacer-right"
             />
-             
             security_reports.list.hotspots
           </div>
         </th>
@@ -46,20 +43,20 @@ exports[`renders 1`] = `
         className="subheader"
       >
         <th
-          colSpan={3}
+          colSpan={2}
         />
         <th
-          className="security-result-column"
+          className="text-right security-result-column"
         >
           security_reports.line.open
         </th>
         <th
-          className="security-result-column"
+          className="text-right security-result-column"
         >
           security_reports.line.in_review
         </th>
         <th
-          className="security-result-column"
+          className="text-right security-result-column"
         >
           security_reports.line.wont_fix
         </th>
@@ -71,18 +68,15 @@ exports[`renders 1`] = `
       >
         <tr>
           <td
-            className="nowrap"
-            colSpan={2}
+            className=""
           >
-            <div
-              className="display-inline-flex-center"
-            >
-              <React.Fragment>
-                A1
-              </React.Fragment>
-            </div>
+            <React.Fragment>
+              A1
+            </React.Fragment>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <div
               className="display-inline-flex-center"
             >
@@ -95,6 +89,7 @@ exports[`renders 1`] = `
                     "query": Object {
                       "id": "foo",
                       "owaspTop10": "a1",
+                      "resolved": "false",
                       "types": "VULNERABILITY",
                     },
                   }
@@ -102,28 +97,35 @@ exports[`renders 1`] = `
               >
                 2
               </Link>
-              <Link
-                className="link-no-underline spacer-left"
-                onlyActiveOnIndex={false}
-                style={Object {}}
-                to={
-                  Object {
-                    "pathname": "/project/issues",
-                    "query": Object {
-                      "id": "foo",
-                      "owaspTop10": "a1",
-                      "types": "VULNERABILITY",
-                    },
-                  }
-                }
+              <Tooltip
+                overlay="metric.security_rating.tooltip.E"
               >
-                <Rating
-                  value={5}
-                />
-              </Link>
+                <Link
+                  className="link-no-underline spacer-left"
+                  onlyActiveOnIndex={false}
+                  style={Object {}}
+                  to={
+                    Object {
+                      "pathname": "/project/issues",
+                      "query": Object {
+                        "id": "foo",
+                        "owaspTop10": "a1",
+                        "resolved": "false",
+                        "types": "VULNERABILITY",
+                      },
+                    }
+                  }
+                >
+                  <Rating
+                    value={5}
+                  />
+                </Link>
+              </Tooltip>
             </div>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -135,7 +137,7 @@ exports[`renders 1`] = `
                     "id": "foo",
                     "owaspTop10": "a1",
                     "resolved": "false",
-                    "statuses": "OPEN",
+                    "statuses": "OPEN,REOPENED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -144,7 +146,9 @@ exports[`renders 1`] = `
               10
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -156,6 +160,7 @@ exports[`renders 1`] = `
                     "id": "foo",
                     "owaspTop10": "a1",
                     "resolutions": "FIXED",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -164,7 +169,9 @@ exports[`renders 1`] = `
               2
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -176,6 +183,7 @@ exports[`renders 1`] = `
                     "id": "foo",
                     "owaspTop10": "a1",
                     "resolutions": "WONTFIX",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -191,18 +199,15 @@ exports[`renders 1`] = `
       >
         <tr>
           <td
-            className="nowrap"
-            colSpan={2}
+            className=""
           >
-            <div
-              className="display-inline-flex-center"
-            >
-              <React.Fragment>
-                UNKNOWN
-              </React.Fragment>
-            </div>
+            <React.Fragment>
+              UNKNOWN
+            </React.Fragment>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <div
               className="display-inline-flex-center"
             >
@@ -215,6 +220,7 @@ exports[`renders 1`] = `
                     "query": Object {
                       "id": "foo",
                       "owaspTop10": "unknown",
+                      "resolved": "false",
                       "types": "VULNERABILITY",
                     },
                   }
@@ -222,28 +228,35 @@ exports[`renders 1`] = `
               >
                 3
               </Link>
-              <Link
-                className="link-no-underline spacer-left"
-                onlyActiveOnIndex={false}
-                style={Object {}}
-                to={
-                  Object {
-                    "pathname": "/project/issues",
-                    "query": Object {
-                      "id": "foo",
-                      "owaspTop10": "unknown",
-                      "types": "VULNERABILITY",
-                    },
-                  }
-                }
+              <Tooltip
+                overlay="metric.security_rating.tooltip.C"
               >
-                <Rating
-                  value={3}
-                />
-              </Link>
+                <Link
+                  className="link-no-underline spacer-left"
+                  onlyActiveOnIndex={false}
+                  style={Object {}}
+                  to={
+                    Object {
+                      "pathname": "/project/issues",
+                      "query": Object {
+                        "id": "foo",
+                        "owaspTop10": "unknown",
+                        "resolved": "false",
+                        "types": "VULNERABILITY",
+                      },
+                    }
+                  }
+                >
+                  <Rating
+                    value={3}
+                  />
+                </Link>
+              </Tooltip>
             </div>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -255,7 +268,7 @@ exports[`renders 1`] = `
                     "id": "foo",
                     "owaspTop10": "unknown",
                     "resolved": "false",
-                    "statuses": "OPEN",
+                    "statuses": "OPEN,REOPENED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -264,7 +277,9 @@ exports[`renders 1`] = `
               100
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -276,6 +291,7 @@ exports[`renders 1`] = `
                     "id": "foo",
                     "owaspTop10": "unknown",
                     "resolutions": "FIXED",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -284,7 +300,9 @@ exports[`renders 1`] = `
               8
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -296,6 +314,7 @@ exports[`renders 1`] = `
                     "id": "foo",
                     "owaspTop10": "unknown",
                     "resolutions": "WONTFIX",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -322,7 +341,6 @@ exports[`renders with cwe 1`] = `
       <tr>
         <th
           className="security-category-column"
-          colSpan={2}
         >
           security_reports.list.categories
         </th>
@@ -335,7 +353,6 @@ exports[`renders with cwe 1`] = `
             <VulnerabilityIcon
               className="spacer-right"
             />
-             
             security_reports.list.vulnerabilities
           </div>
         </th>
@@ -348,7 +365,6 @@ exports[`renders with cwe 1`] = `
             <SecurityHotspotIcon
               className="spacer-right"
             />
-             
             security_reports.list.hotspots
           </div>
         </th>
@@ -357,20 +373,20 @@ exports[`renders with cwe 1`] = `
         className="subheader"
       >
         <th
-          colSpan={3}
+          colSpan={2}
         />
         <th
-          className="security-result-column"
+          className="text-right security-result-column"
         >
           security_reports.line.open
         </th>
         <th
-          className="security-result-column"
+          className="text-right security-result-column"
         >
           security_reports.line.in_review
         </th>
         <th
-          className="security-result-column"
+          className="text-right security-result-column"
         >
           security_reports.line.wont_fix
         </th>
@@ -382,18 +398,15 @@ exports[`renders with cwe 1`] = `
       >
         <tr>
           <td
-            className="nowrap"
-            colSpan={2}
+            className=""
           >
-            <div
-              className="display-inline-flex-center"
-            >
-              <React.Fragment>
-                A1
-              </React.Fragment>
-            </div>
+            <React.Fragment>
+              A1
+            </React.Fragment>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <div
               className="display-inline-flex-center"
             >
@@ -406,6 +419,7 @@ exports[`renders with cwe 1`] = `
                     "query": Object {
                       "id": "foo",
                       "owaspTop10": "a1",
+                      "resolved": "false",
                       "types": "VULNERABILITY",
                     },
                   }
@@ -413,28 +427,35 @@ exports[`renders with cwe 1`] = `
               >
                 2
               </Link>
-              <Link
-                className="link-no-underline spacer-left"
-                onlyActiveOnIndex={false}
-                style={Object {}}
-                to={
-                  Object {
-                    "pathname": "/project/issues",
-                    "query": Object {
-                      "id": "foo",
-                      "owaspTop10": "a1",
-                      "types": "VULNERABILITY",
-                    },
-                  }
-                }
+              <Tooltip
+                overlay="metric.security_rating.tooltip.E"
               >
-                <Rating
-                  value={5}
-                />
-              </Link>
+                <Link
+                  className="link-no-underline spacer-left"
+                  onlyActiveOnIndex={false}
+                  style={Object {}}
+                  to={
+                    Object {
+                      "pathname": "/project/issues",
+                      "query": Object {
+                        "id": "foo",
+                        "owaspTop10": "a1",
+                        "resolved": "false",
+                        "types": "VULNERABILITY",
+                      },
+                    }
+                  }
+                >
+                  <Rating
+                    value={5}
+                  />
+                </Link>
+              </Tooltip>
             </div>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -446,7 +467,7 @@ exports[`renders with cwe 1`] = `
                     "id": "foo",
                     "owaspTop10": "a1",
                     "resolved": "false",
-                    "statuses": "OPEN",
+                    "statuses": "OPEN,REOPENED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -455,7 +476,9 @@ exports[`renders with cwe 1`] = `
               10
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -467,6 +490,7 @@ exports[`renders with cwe 1`] = `
                     "id": "foo",
                     "owaspTop10": "a1",
                     "resolutions": "FIXED",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -475,7 +499,9 @@ exports[`renders with cwe 1`] = `
               2
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -487,6 +513,7 @@ exports[`renders with cwe 1`] = `
                     "id": "foo",
                     "owaspTop10": "a1",
                     "resolutions": "WONTFIX",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -500,20 +527,16 @@ exports[`renders with cwe 1`] = `
           key="42"
         >
           <tr>
-            <td />
             <td
-              className="nowrap"
-              colSpan={1}
+              className="cwe-title-cell"
             >
-              <div
-                className="display-inline-flex-center"
-              >
-                <React.Fragment>
-                  CWE-42
-                </React.Fragment>
-              </div>
+              <React.Fragment>
+                CWE-42
+              </React.Fragment>
             </td>
-            <td>
+            <td
+              className="text-right"
+            >
               <div
                 className="display-inline-flex-center"
               >
@@ -524,8 +547,9 @@ exports[`renders with cwe 1`] = `
                     Object {
                       "pathname": "/project/issues",
                       "query": Object {
+                        "cwe": "42",
                         "id": "foo",
-                        "owaspTop10": "42",
+                        "resolved": "false",
                         "types": "VULNERABILITY",
                       },
                     }
@@ -533,28 +557,35 @@ exports[`renders with cwe 1`] = `
                 >
                   1
                 </Link>
-                <Link
-                  className="link-no-underline spacer-left"
-                  onlyActiveOnIndex={false}
-                  style={Object {}}
-                  to={
-                    Object {
-                      "pathname": "/project/issues",
-                      "query": Object {
-                        "id": "foo",
-                        "owaspTop10": "42",
-                        "types": "VULNERABILITY",
-                      },
-                    }
-                  }
+                <Tooltip
+                  overlay="metric.security_rating.tooltip.A"
                 >
-                  <Rating
-                    value={1}
-                  />
-                </Link>
+                  <Link
+                    className="link-no-underline spacer-left"
+                    onlyActiveOnIndex={false}
+                    style={Object {}}
+                    to={
+                      Object {
+                        "pathname": "/project/issues",
+                        "query": Object {
+                          "cwe": "42",
+                          "id": "foo",
+                          "resolved": "false",
+                          "types": "VULNERABILITY",
+                        },
+                      }
+                    }
+                  >
+                    <Rating
+                      value={1}
+                    />
+                  </Link>
+                </Tooltip>
               </div>
             </td>
-            <td>
+            <td
+              className="text-right"
+            >
               <Link
                 className="spacer-right"
                 onlyActiveOnIndex={false}
@@ -563,10 +594,10 @@ exports[`renders with cwe 1`] = `
                   Object {
                     "pathname": "/project/issues",
                     "query": Object {
+                      "cwe": "42",
                       "id": "foo",
-                      "owaspTop10": "42",
                       "resolved": "false",
-                      "statuses": "OPEN",
+                      "statuses": "OPEN,REOPENED",
                       "types": "SECURITY_HOTSPOT",
                     },
                   }
@@ -575,7 +606,9 @@ exports[`renders with cwe 1`] = `
                 10
               </Link>
             </td>
-            <td>
+            <td
+              className="text-right"
+            >
               <Link
                 className="spacer-right"
                 onlyActiveOnIndex={false}
@@ -584,9 +617,10 @@ exports[`renders with cwe 1`] = `
                   Object {
                     "pathname": "/project/issues",
                     "query": Object {
+                      "cwe": "42",
                       "id": "foo",
-                      "owaspTop10": "42",
                       "resolutions": "FIXED",
+                      "statuses": "RESOLVED",
                       "types": "SECURITY_HOTSPOT",
                     },
                   }
@@ -595,7 +629,9 @@ exports[`renders with cwe 1`] = `
                 2
               </Link>
             </td>
-            <td>
+            <td
+              className="text-right"
+            >
               <Link
                 className="spacer-right"
                 onlyActiveOnIndex={false}
@@ -604,9 +640,10 @@ exports[`renders with cwe 1`] = `
                   Object {
                     "pathname": "/project/issues",
                     "query": Object {
+                      "cwe": "42",
                       "id": "foo",
-                      "owaspTop10": "42",
                       "resolutions": "WONTFIX",
+                      "statuses": "RESOLVED",
                       "types": "SECURITY_HOTSPOT",
                     },
                   }
@@ -623,18 +660,15 @@ exports[`renders with cwe 1`] = `
       >
         <tr>
           <td
-            className="nowrap"
-            colSpan={2}
+            className=""
           >
-            <div
-              className="display-inline-flex-center"
-            >
-              <React.Fragment>
-                UNKNOWN
-              </React.Fragment>
-            </div>
+            <React.Fragment>
+              UNKNOWN
+            </React.Fragment>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <div
               className="display-inline-flex-center"
             >
@@ -647,6 +681,7 @@ exports[`renders with cwe 1`] = `
                     "query": Object {
                       "id": "foo",
                       "owaspTop10": "unknown",
+                      "resolved": "false",
                       "types": "VULNERABILITY",
                     },
                   }
@@ -654,28 +689,35 @@ exports[`renders with cwe 1`] = `
               >
                 3
               </Link>
-              <Link
-                className="link-no-underline spacer-left"
-                onlyActiveOnIndex={false}
-                style={Object {}}
-                to={
-                  Object {
-                    "pathname": "/project/issues",
-                    "query": Object {
-                      "id": "foo",
-                      "owaspTop10": "unknown",
-                      "types": "VULNERABILITY",
-                    },
-                  }
-                }
+              <Tooltip
+                overlay="metric.security_rating.tooltip.C"
               >
-                <Rating
-                  value={3}
-                />
-              </Link>
+                <Link
+                  className="link-no-underline spacer-left"
+                  onlyActiveOnIndex={false}
+                  style={Object {}}
+                  to={
+                    Object {
+                      "pathname": "/project/issues",
+                      "query": Object {
+                        "id": "foo",
+                        "owaspTop10": "unknown",
+                        "resolved": "false",
+                        "types": "VULNERABILITY",
+                      },
+                    }
+                  }
+                >
+                  <Rating
+                    value={3}
+                  />
+                </Link>
+              </Tooltip>
             </div>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -687,7 +729,7 @@ exports[`renders with cwe 1`] = `
                     "id": "foo",
                     "owaspTop10": "unknown",
                     "resolved": "false",
-                    "statuses": "OPEN",
+                    "statuses": "OPEN,REOPENED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -696,7 +738,9 @@ exports[`renders with cwe 1`] = `
               100
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -708,6 +752,7 @@ exports[`renders with cwe 1`] = `
                     "id": "foo",
                     "owaspTop10": "unknown",
                     "resolutions": "FIXED",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
@@ -716,7 +761,9 @@ exports[`renders with cwe 1`] = `
               8
             </Link>
           </td>
-          <td>
+          <td
+            className="text-right"
+          >
             <Link
               className="spacer-right"
               onlyActiveOnIndex={false}
@@ -728,6 +775,7 @@ exports[`renders with cwe 1`] = `
                     "id": "foo",
                     "owaspTop10": "unknown",
                     "resolutions": "WONTFIX",
+                    "statuses": "RESOLVED",
                     "types": "SECURITY_HOTSPOT",
                   },
                 }
index bf6e1ab8ace08cf3c775f27466ae1ea23cd75e03..c6159cc467cacb20b89c40abca108bb7a58f62a8 100644 (file)
@@ -24,3 +24,7 @@
 .security-result-column {
   width: 12%;
 }
+
+.cwe-title-cell {
+  padding-left: 80px !important;
+}
index 9a937e7c842dd3e92481196d9d410a9f7c9b7c20..f2d32e1715b3872831f6f2da5ef15123326bb063 100644 (file)
@@ -73,7 +73,7 @@
   },
   "cwe": {
     "unknown": {
-      "title": "Unknown CWE"
+      "title": "No CWE associated"
     },
     "1004": {
       "title": "Sensitive Cookie Without 'HttpOnly' Flag",