Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-74660

[peass-ci] Extract inline script blocks and event handlers in de/dagere/peass/ci/MeasurementOverviewAction/index.jelly

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • _unsorted

      Problems

      == Inline Script Block
      Line: 26
      ----
      <script> jq$ = jQuery.noConflict();</script>
      ----
      
      == Inline Script Block
      Line: 34
      ----
      <script>
                jq$("#dialogGeneral").dialog({ autoOpen: false });
              </script>
      ----
      
      == Inline Script Block
      Line: 68
      ----
      <script>
                jq$( "#dialogUpdates" ).dialog({ autoOpen: false });
              </script>
      ----
      
      == Inline Script Block
      Line: 93
      ----
      <script>
              jq$( "#dialogChanges" ).dialog({ autoOpen: false });
            </script>
      ----
      
      == Inline Script Block
      Line: 133
      ----
      <script>
              jq$( "#dialogMeasurements" ).dialog({ autoOpen: false });
            </script>
      ----
      
      == Inline Script Block
      Line: 138
      ----
      <script>
              <j:forEach var="measurements" items="${it.measurements.entrySet()}">
                <j:set var="meanOld" value="${it.getMeanOfValues(measurements.getValue().getValuesBefore())}" />
                <j:set var="factor" value="${it.getFactorByMean(meanOld)}" />
                var layout = {
                  barmode: "overlay",
                  title: {
                    text: "Histogramm"
                  },
                  xaxis: {
                    title: {
                      text: "Duration / ${it.getUnitByFactor(factor)}"
                    }
                  },
                  yaxis: {
                    title: {
                      text: "Frequency"
                    }
                  },
                  height: 400
                };
                <j:set var="histogramValues" value="${measurements.getValue()}" />
                <j:set var="valuesCurrent" value="${histogramValues.getValuesCurrent()}" />
                <j:set var="dividedValuesCurrent" value="${it.divideValuesByFactor(valuesCurrent, histogramValues.getCurrentConfig(), factor)}" />
                var current = {
                  x: ${it.getValuesReadable(dividedValuesCurrent)},
                  type: "histogram",
                  name: "Current",
                  opacity: 0.5,
                  marker: {
                    color: 'green',
                  },
                };
                var predecessor = {
                  <j:set var="valuesBefore" value="${histogramValues.getValuesBefore()}" />
                  <j:set var="dividedValuesBefore" value="${it.divideValuesByFactor(valuesBefore, histogramValues.getCurrentConfig(), factor)}" />
                  x: ${it.getValuesReadable(dividedValuesBefore)},
                  type: "histogram",
                  name: "Predecessor",
                  opacity: 0.6,
                  marker: {
                    color: 'red',
                  },
                };
                var data = [current, predecessor];
                var config = {
                  responsive: true
                };
                Plotly.newPlot("histogramm_${measurements.getKey()}", data, layout, config);
              </j:forEach>
            </script>
      ----
      
      == Inline Event Handler
      Line: 30
      ----
      <a href='#' onClick='jq$( "#dialogGeneral" ).dialog( "open" );'>
      ----
      
      == Inline Event Handler
      Line: 39
      ----
      <a href="#" onClick="jq$('#configuration').toggle();">
      ----
      
      == Inline Event Handler
      Line: 64
      ----
      <a href='#' onClick='jq$( "#dialogUpdates" ).dialog( "open" );' style="font-size:24px; color: yellow;">
      ----
      
      == Inline Event Handler
      Line: 75
      ----
      <a href='#' onClick='jq$( "#dialogChanges" ).dialog( "open" );'>
      ----
      
      == Inline Event Handler
      Line: 128
      ----
      <a href='#' onClick='jq$( "#dialogMeasurements" ).dialog( "open" );'>
      ----
      

      Solutions

      https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
      https://www.jenkins.io/doc/developer/security/csp/#inline-event-handlers

            Unassigned Unassigned
            basil Basil Crow
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: