Package com.ubx1.pdpscanner.shared

Examples of com.ubx1.pdpscanner.shared.Project


   *
   * @return the data table for the chart
   */
  private AbstractDataTable createTestChartDataTable() {

    Project p = this.project;
    int v = this.version;

    HashMap<String, HashMap<String, ArrayList<FindbugsBugInstance>>> pMap = Project
        .getFbMap(p.getP(v));

    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "");

    data.addRows(1);
View Full Code Here


   *
   * @return the data table for the chart
   */
  private AbstractDataTable createChartDataTable() {

    Project p = this.project;

    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "Version");

    ArrayList<FindbugsBugInstance> allBp = new ArrayList<FindbugsBugInstance>();
    for (int i = 0; i < p.getVersionCount(); i++) {

      if (p.getBp(i + 1) != null)
        allBp.addAll(p.getBp(i + 1));
    }

    Set<String> usedAbbrevs = new TreeSet<String>();
    for (int i = 0; i < allBp.size(); i++) {

      usedAbbrevs.add(allBp.get(i).getAbbrev());
    }

    data.addRows(p.getVersionCount());

    Iterator<String> it = usedAbbrevs.iterator();
    while (it.hasNext()) {

      String abbrev = it.next();

      int col = data.addColumn(ColumnType.NUMBER,
          FindbugsBugInstance.getAbbrevDescription(abbrev));

      // Unavailable stats counter
      int z = 0;

      for (int i = 0; i < p.getVersionCount(); i++) {

        if (p.getBp(i + 1) == null) {
          z++;
        } else {

          // Version
          data.setValue(i - z, 0, String.valueOf(i + 1));
View Full Code Here

   *
   * @return the data table for the chart
   */
  private AbstractDataTable createTestChartDataTable() {

    Project p = this.project;
    int v = this.version;

    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "Couverture de code");
    data.addColumn(ColumnType.NUMBER, "Nombre de lignes de code");
    data.addRows(2);

    int locValue = p.getNloc(v);
    int covValue = p.getNcovl(v);

    data.setValue(0, 0, "Lignes de code non testées");
    data.setValue(0, 1, locValue - covValue);
    data.setValue(1, 0, "Lignes de code testées");
    data.setValue(1, 1, covValue);
View Full Code Here

  /**
   * Delete the project
   */
  private void deleteProject() {

    Project p = this.project;

    // Prepare callback
    AsyncCallback<String> callback = new AsyncCallback<String>() {

      @Override
      public void onFailure(Throwable caught) {

        System.err.println(caught.getClass().getName() + " :: "
            + caught.getMessage());
        caught.printStackTrace();

        Window.alert(PdpScanner.DELETE_PROJECT_ERROR);
      }

      @Override
      public void onSuccess(String result) {

        Window.alert(PdpScanner.DELETE_PROJECT_SUCCESS);

        History.newItem("Home");
      }
    };

    // Tell the project to delete the project from the database
    PdpScanner.projectService.deleteProject(p.getId(), callback);
  }
View Full Code Here

   * Fill the performance UI tree to display the performance issues grouped by
   * categories
   */
  private void fillTree() {

    Project p = this.project;

    ArrayList<FindbugsBugInstance> perf = p.getP(this.version);

    HashMap<String, HashMap<String, ArrayList<FindbugsBugInstance>>> pMap = Project
        .getFbMap(perf);

    Iterator<String> it1 = pMap.keySet().iterator();
View Full Code Here

   * @param s
   *            the stat kind
   */
  private void fillLabel(GeneralStat s) {

    Project p = this.project;
    int v = this.version;

    switch (s) {
    case LOC:
      locLabel.setText("Lignes de code : "
          + (p.getNloc(v) == -1 ? "--" : p.getNloc(v)));
      break;
    case FUNC:
      funcLabel.setText("Fonctions : "
          + (p.getNfunc(v) == -1 ? "--" : p.getNfunc(v)));
      break;
    case CL:
      clLabel.setText("Classes : "
          + (p.getNcl(v) == -1 ? "--" : p.getNcl(v)));
      break;
    case PKG:
      pkgLabel.setText("Packages : "
          + (p.getNpkg(v) == -1 ? "--" : p.getNpkg(v)));
      break;
    case FILE:
      fileLabel.setText("Fichiers : "
          + (p.getNfile(v) == -1 ? "--" : p.getNfile(v)));
      break;
    default:

    }
  }
View Full Code Here

    // Project view requested
    else if (event.getValue().startsWith("Project~")) {

      // Get which project to display on the Project view
      String projectName = event.getValue().substring(8);
      Project p = projects.get(projectName);

      // Fetch the project's stats before constructing the project view
      fetchStats(p);

    }
View Full Code Here

    ArrayList<Project> projectsList = new ArrayList<>();

    while (rs1.next()) {

      Project p = new Project(rs1.getInt("id"),
          rs1.getString("users.name"),
          rs1.getString("projects.name"), rs1.getString("repos_url"),
          rs1.getString("repos_user"),
          rs1.getString("repos_password"), rs1.getDate(
              "creation_date").toString()
              + " " + rs1.getTime("creation_date").toString());

      // Get project's loc stat for all versions
      ResultSet rs2 = conn
          .SQLSelect("SELECT * FROM versions JOIN general_stats "
              + "ON versions.project = " + rs1.getInt("id")
              + " AND general_stats.version = versions.id "
              + "ORDER BY versions.version");

      while (rs2.next()) {
        int nloc = rs2.getInt("nloc");
        if (!rs2.wasNull())
          p.addNloc(nloc);
        else
          p.addNloc(-1);
      }

      projectsList.add(p);
    }

View Full Code Here

   *
   * @return the data table for the chart
   */
  private AbstractDataTable createChartDataTable() {

    Project p = this.project;

    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "Version");

    ArrayList<FindbugsBugInstance> allP = new ArrayList<FindbugsBugInstance>();
    for (int i = 0; i < p.getVersionCount(); i++) {

      if (p.getP(i + 1) != null)
        allP.addAll(p.getP(i + 1));
    }

    Set<String> usedAbbrevs = new TreeSet<String>();
    for (int i = 0; i < allP.size(); i++) {

      usedAbbrevs.add(allP.get(i).getAbbrev());
    }

    data.addRows(p.getVersionCount());

    Iterator<String> it = usedAbbrevs.iterator();
    while (it.hasNext()) {

      String abbrev = it.next();

      int col = data.addColumn(ColumnType.NUMBER,
          FindbugsBugInstance.getAbbrevDescription(abbrev));

      // Unavailable stats counter
      int z = 0;

      for (int i = 0; i < p.getVersionCount(); i++) {

        if (p.getP(i + 1) == null) {
          z++;
        } else {

          // Version
          data.setValue(i - z, 0, String.valueOf(i + 1));
View Full Code Here

   *            the kind of general stat we need for representing the chart
   * @return the data table for the chart
   */
  private AbstractDataTable createChartDataTable(GeneralStat s) {

    Project p = this.project;

    DataTable data = DataTable.create();
    data.addColumn(ColumnType.STRING, "Version");
    data.addColumn(ColumnType.NUMBER, getChartLegend(s));
    data.addRows(p.getVersionCount());

    // Unavailable stats counter
    int z = 0;

    for (int i = 0; i < p.getVersionCount(); i++) {

      int statValue = getChartValue(s, i + 1);
      // If no value is available for this version, don't represent it on
      // the chart

View Full Code Here

TOP

Related Classes of com.ubx1.pdpscanner.shared.Project

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.