Package org.sonar.api.web.Dashboard

Examples of org.sonar.api.web.Dashboard.Widget


    addSecondColumn(dashboard);
    return dashboard;
  }

  private void addFirstColumn(Dashboard dashboard) {
    Widget timelineWidget = dashboard.addWidget("timeline", 1);
    timelineWidget.setProperty(METRIC1, CoreMetrics.COMPLEXITY_KEY);
    timelineWidget.setProperty(METRIC2, CoreMetrics.TECHNICAL_DEBT_KEY);
    timelineWidget.setProperty(METRIC3, CoreMetrics.COVERAGE_KEY);

    Widget sizeTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard);
    sizeTimeMachineWidget.setProperty(METRIC1, CoreMetrics.NCLOC_KEY);
    sizeTimeMachineWidget.setProperty(METRIC2, CoreMetrics.LINES_KEY);
    sizeTimeMachineWidget.setProperty(METRIC3, CoreMetrics.STATEMENTS_KEY);
    sizeTimeMachineWidget.setProperty(METRIC4, CoreMetrics.FILES_KEY);
    sizeTimeMachineWidget.setProperty(METRIC5, CoreMetrics.CLASSES_KEY);
    sizeTimeMachineWidget.setProperty(METRIC6, CoreMetrics.FUNCTIONS_KEY);
    sizeTimeMachineWidget.setProperty(METRIC7, CoreMetrics.ACCESSORS_KEY);

    Widget commentsTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard);
    commentsTimeMachineWidget.setProperty(METRIC1, CoreMetrics.COMMENT_LINES_DENSITY_KEY);
    commentsTimeMachineWidget.setProperty(METRIC2, CoreMetrics.COMMENT_LINES_KEY);
    commentsTimeMachineWidget.setProperty(METRIC3, CoreMetrics.PUBLIC_DOCUMENTED_API_DENSITY_KEY);
    commentsTimeMachineWidget.setProperty(METRIC4, CoreMetrics.PUBLIC_UNDOCUMENTED_API_KEY);

    Widget duplicationTimeMachineWidget = addTimeMachineWidgetOnFirstColumn(dashboard);
    duplicationTimeMachineWidget.setProperty(METRIC1, CoreMetrics.DUPLICATED_LINES_DENSITY_KEY);
    duplicationTimeMachineWidget.setProperty(METRIC2, CoreMetrics.DUPLICATED_LINES_KEY);
    duplicationTimeMachineWidget.setProperty(METRIC3, CoreMetrics.DUPLICATED_BLOCKS_KEY);
    duplicationTimeMachineWidget.setProperty(METRIC4, CoreMetrics.DUPLICATED_FILES_KEY);
  }
View Full Code Here


    duplicationTimeMachineWidget.setProperty(METRIC3, CoreMetrics.DUPLICATED_BLOCKS_KEY);
    duplicationTimeMachineWidget.setProperty(METRIC4, CoreMetrics.DUPLICATED_FILES_KEY);
  }

  private void addSecondColumn(Dashboard dashboard) {
    Widget rulesTimeMachineWidget = addTimeMachineWidgetOnSecondColumn(dashboard);
    rulesTimeMachineWidget.setProperty(METRIC1, CoreMetrics.VIOLATIONS_KEY);
    rulesTimeMachineWidget.setProperty(METRIC2, CoreMetrics.BLOCKER_VIOLATIONS_KEY);
    rulesTimeMachineWidget.setProperty(METRIC3, CoreMetrics.CRITICAL_VIOLATIONS_KEY);
    rulesTimeMachineWidget.setProperty(METRIC4, CoreMetrics.MAJOR_VIOLATIONS_KEY);
    rulesTimeMachineWidget.setProperty(METRIC5, CoreMetrics.MINOR_VIOLATIONS_KEY);
    rulesTimeMachineWidget.setProperty(METRIC6, CoreMetrics.INFO_VIOLATIONS_KEY);
    rulesTimeMachineWidget.setProperty(METRIC7, CoreMetrics.TECHNICAL_DEBT_KEY);

    Widget complexityTimeMachineWidget = addTimeMachineWidgetOnSecondColumn(dashboard);
    complexityTimeMachineWidget.setProperty(METRIC1, CoreMetrics.COMPLEXITY_KEY);
    complexityTimeMachineWidget.setProperty(METRIC2, CoreMetrics.FUNCTION_COMPLEXITY_KEY);
    complexityTimeMachineWidget.setProperty(METRIC3, CoreMetrics.CLASS_COMPLEXITY_KEY);
    complexityTimeMachineWidget.setProperty(METRIC4, CoreMetrics.FILE_COMPLEXITY_KEY);

    Widget testsTimeMachineWidget = addTimeMachineWidgetOnSecondColumn(dashboard);
    testsTimeMachineWidget.setProperty(METRIC1, CoreMetrics.COVERAGE_KEY);
    testsTimeMachineWidget.setProperty(METRIC2, CoreMetrics.LINE_COVERAGE_KEY);
    testsTimeMachineWidget.setProperty(METRIC3, CoreMetrics.BRANCH_COVERAGE_KEY);
    testsTimeMachineWidget.setProperty(METRIC4, CoreMetrics.TEST_SUCCESS_DENSITY_KEY);
    testsTimeMachineWidget.setProperty(METRIC5, CoreMetrics.TEST_FAILURES_KEY);
    testsTimeMachineWidget.setProperty(METRIC6, CoreMetrics.TEST_ERRORS_KEY);
    testsTimeMachineWidget.setProperty(METRIC7, CoreMetrics.TESTS_KEY);
    testsTimeMachineWidget.setProperty(METRIC8, CoreMetrics.TEST_EXECUTION_TIME_KEY);
  }
View Full Code Here

  private Widget addTimeMachineWidgetOnSecondColumn(Dashboard dashboard) {
    return addTimeMachineWidget(dashboard, 2);
  }

  private Widget addTimeMachineWidget(Dashboard dashboard, int columnIndex) {
    Widget widget = dashboard.addWidget("time_machine", columnIndex);
    widget.setProperty("displaySparkLine", "true");
    return widget;
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.web.Dashboard.Widget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.