<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Plato - App.js</title>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">

  <!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
  <![endif]-->

  <link href="../../assets/css/vendor/morris.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/vendor/bootstrap.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/vendor/font-awesome.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/vendor/codemirror.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/plato.css" rel="stylesheet" type="text/css">
  <link href="../../assets/css/plato-file.css" rel="stylesheet" type="text/css">

</head>

<body>

<div class="navbar navbar-fixed-top">
  <div class="container">
    <a class="navbar-brand" href="https://github.com/the-simian/es6-plato">ES6 Plato on Github</a>
    <ul class="nav navbar-nav">
      <li>
        <a href="../../index.html">Report Home</a>
      </li>
      <li class="active">
        <a href="display.html">Summary Display</a>
      </li>
    </ul>
  </div>
</div>

<div class="jumbotron">
  <div class="container">
    <h1>App.js</h1>
  </div>
</div>

<div class="container aggregate-stats">
  <div class="row">
    <div class="col-md-6">
      <h2 class="header">Maintainability <a href="http://blogs.msdn.com/b/codeanalysis/archive/2007/11/20/maintainability-index-range-and-meaning.aspx"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="A value between 0 and 100 that represents the relative ease of maintaining the code. A high value means better maintainability." data-original-title="Maintainability Index"  data-container="body"></i></a></h2>
      <p class="stat">80.38</p>
    </div>
    <div class="col-md-6">
      <h2 class="header">Lines of code <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC" data-container="body"></i></h2>
      <p class="stat">292</p>
    </div>
  </div>
  <div class="row historical">
    <div class="col-md-6">
      <p id="chart_historical_maint" class="chart"></p>
    </div>
    <div class="col-md-6">
      <p id="chart_historical_sloc" class="chart"></p>
    </div>
  </div>
  <div class="row">
    <div class="col-md-6">
      <h2 class="header">Difficulty  <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="The difficulty measure is related to the difficulty of the program to write or understand." data-original-title="Difficulty" data-container="body"></i></a></h2>
      <p class="stat">23.04</p>
    </div>
    <div class="col-md-6">
      <h2 class="header">Estimated Errors  <a href="http://en.wikipedia.org/wiki/Halstead_complexity_measures"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Halstead's delivered bugs is an estimate for the number of errors in the implementation." data-original-title="Delivered Bugs" data-container="body"></i></a></h2>
      <p class="stat">1.09</p>
    </div>
  </div>
</div>

<div class="container charts">
  <div class="row">
    <h2 class="header">Function weight</h2>
  </div>
  <div class="row">
    <div class="col-md-6">
      <h3 class="chart-header">By Complexity <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity"><i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="This metric counts the number of distinct paths through a block of code. Lower values are better." data-original-title="Cyclomatic Complexity" data-container="body"></i></a></h3>
      <div id="fn-by-complexity" class="stat"></div>
    </div>
    <div class="col-md-6">
      <h3 class="chart-header">By SLOC  <i class="icon icon-info-sign" rel="popover" data-placement="top" data-trigger="hover" data-content="Source Lines of Code / Logical Lines of Code" data-original-title="SLOC/LSLOC" data-container="body"></i></h3>
      <div id="fn-by-sloc" class="stat"></div>
    </div>
  </div>
</div>

<div class="container">
  <div class="row">
    <textarea id="file-source" class="col-md-12">import React, { Component } from &#039;react&#039;;
import { connect } from &#039;react-redux&#039;;
import &#039;./App.css&#039;;
import &quot;babel-polyfill&quot;;
import { Panel, Glyphicon } from &#039;react-bootstrap&#039;;
import LoginContainer from &#039;./containers/LoginContainer.js&#039;;
import ExpirationLoginContainer from &#039;./containers/ExpirationLoginContainer.js&#039;;
import InvestigationsContainer from &#039;./containers/InvestigationsContainer.js&#039;;
import DataCollectionsContainer from &#039;./containers/DataCollectionsContainer.js&#039;;
import CameraContainer from &#039;./containers/CameraContainer.js&#039;;
import MenuContainer from &#039;./containers/MenuContainer.js&#039;;
import InvestigationContainer from &#039;./containers/Investigation/InvestigationContainer.js&#039;;
import SearchContainer from &#039;./containers/SearchContainer.js&#039;;
import SelectionContainer from &#039;./containers/Selection/SelectionContainer.js&#039;;
import MintSelectionContainer from &#039;./containers/Selection/MintSelectionContainer.js&#039;;
import Footer from &#039;./components/Footer.js&#039;;
import _ from &#039;lodash&#039;;


import { BrowserRouter as Router, Route } from &quot;react-router-dom&quot;;
import TagContainer from &#039;./containers/TagContainer&#039;;
import { fetchDatasetsByDOI } from &#039;./actions/datasets.js&#039;;
import { TAG_MANAGER_CONTEXT } from &#039;./constants/EventTypes&#039;;

class App extends Component {
    render() {
        return (
            &lt;Router&gt;
                &lt;div&gt;
                    &lt;Route exact path=&quot;/&quot; component={MyDataPage} /&gt;

                    &lt;Route exact path=&quot;/home&quot; component={MyDataPage} /&gt;

                    &lt;Route exact path=&quot;/search&quot; component={MySearchPage} /&gt;

                    &lt;Route exact path=&quot;/investigations&quot; render={props =&gt; (&lt;MyDataPage {...this.props} /&gt;)} /&gt;

                    &lt;Route exact path=&quot;/public&quot; render={props =&gt; (&lt;OpenDataPage {...this.props} /&gt;)} /&gt;
                    &lt;Route exact path=&quot;/public/:prefix/:suffix&quot; component={DOIPage} /&gt;

                    &lt;Route exact path=&quot;/closed&quot; render={props =&gt; (&lt;ClosedDataPage {...this.props} /&gt;)} /&gt;

                    &lt;Route exact path=&quot;/investigation/:investigationId/datasets&quot; component={DatasetsPage} /&gt;
                    &lt;Route exact path=&quot;/investigation/:investigationId/events/tagManager&quot; component={EventTagPage} /&gt;
                    &lt;Route exact path=&quot;/investigation/:investigationId/events&quot; component={EventsPage} /&gt;
                    &lt;Route exact path=&quot;/investigation/:investigationId/camera&quot; component={CameraPage} /&gt;


                    &lt;Route exact path=&quot;/selection&quot; component={SelectionPage} /&gt;
                    &lt;Route exact path=&quot;/selection/mint&quot; component={MintSelectionPage} /&gt;



                    &lt;Footer&gt;&lt;/Footer&gt;
                &lt;/div&gt;
            &lt;/Router&gt;
        );
    }

}




class WelcomePage extends React.Component {
    render() {
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
            &lt;/div&gt;
        );
    }
}

class DOIPage extends React.Component {
    render() {
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
                &lt;InvestigationContainer doi={this.props.match.params.prefix + &quot;/&quot; + this.props.match.params.suffix} isDOI={true} activeTab={1} {...this.props} /&gt;

            &lt;/div&gt;
        );
    }
}


class SelectionPage extends React.Component {
    render() {
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
                &lt;SelectionContainer {...this.props} /&gt;
            &lt;/div&gt;
        );
    }
}

class MintSelectionPage extends React.Component {
    render() {
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
                &lt;MintSelectionContainer investigationId={this.props.match.params.investigationId} {...this.props} /&gt;
            &lt;/div&gt;
        );
    }
}


class MySearchPage extends React.Component {
    render() {
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;

                &lt;div style={{ marginTop: &#039;30px&#039;, marginLeft: &#039;30px&#039;, marginRight: &#039;30px&#039; }}&gt;
                    &lt;SearchContainer linkProposal={true} openData={true} investigations={this.props.myInvestigations} /&gt;
                &lt;/div&gt;


            &lt;/div&gt;
        );
    }

}

class MyDataPage extends React.Component {
    render() {
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;

                &lt;div style={{ marginTop: &#039;30px&#039;, marginLeft: &#039;30px&#039;, marginRight: &#039;30px&#039; }}&gt;
                    &lt;InvestigationsContainer linkProposal={true} openData={true} investigations={this.props.myInvestigations} /&gt;
                &lt;/div&gt;


            &lt;/div&gt;
        );
    }

}

class ClosedDataPage extends React.Component {
    render() {
        if ((!this.props.user) || (!this.props.user.sessionId)) {
            return &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
            &lt;/div&gt;;
        }
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;

                &lt;Panel bsStyle=&#039;danger&#039; style={{ marginTop: &#039;30px&#039;, marginLeft: &#039;30px&#039;, marginRight: &#039;30px&#039; }}&gt;
                    &lt;Panel.Heading&gt;
                        &lt;Panel.Title componentClass=&quot;h2&quot;&gt; &lt;Glyphicon glyph=&quot;lock&quot; style={{ marginRight: &quot;10px&quot; }} /&gt;These investigations are under embargo&lt;/Panel.Title&gt;
                    &lt;/Panel.Heading&gt;
                    &lt;Panel&gt;
                        &lt;Panel.Body&gt;
                            &lt;InvestigationsContainer linkProposal={false} investigations={this.props.investigations} openData={false} {...this.props} /&gt;
                        &lt;/Panel.Body&gt;
                    &lt;/Panel&gt;
                &lt;/Panel&gt;


            &lt;/div&gt;
        );
    }

}

class OpenDataPage extends React.Component {
    render() {
        if ((!this.props.user) || (!this.props.user.sessionId)) {
            return &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
            &lt;/div&gt;;
        }
        return (
            &lt;div&gt;
                &lt;MenuContainer /&gt;
                &lt;LoginContainer /&gt;
                &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
                &lt;Panel bsStyle=&quot;primary&quot; style={{ marginTop: &#039;30px&#039;, marginLeft: &#039;30px&#039;, marginRight: &#039;30px&#039; }}&gt;
                    &lt;Panel.Heading &gt;
                        &lt;Panel.Title componentClass=&quot;h2&quot;&gt; &lt;Glyphicon glyph=&quot;eye-open&quot; /&gt; Open Data Collections&lt;/Panel.Title&gt;
                    &lt;/Panel.Heading&gt;

                    &lt;Panel.Body&gt;
                        &lt;DataCollectionsContainer openData={true} {...this.props} /&gt;
                    &lt;/Panel.Body&gt;

                &lt;/Panel&gt;
                &lt;Panel bsStyle=&quot;primary&quot; style={{ marginTop: &#039;30px&#039;, marginLeft: &#039;30px&#039;, marginRight: &#039;30px&#039; }}&gt;
                    &lt;Panel.Heading &gt;
                        &lt;Panel.Title componentClass=&quot;h2&quot;&gt; &lt;Glyphicon glyph=&quot;eye-open&quot; /&gt; Open Investigations&lt;/Panel.Title&gt;
                    &lt;/Panel.Heading&gt;

                    &lt;Panel.Body&gt;
                        &lt;InvestigationsContainer
                            linkProposal={false}
                            investigations={this.props.releasedInvestigations}
                            linkProposal={true}
                            closedData={false}
                        /&gt;
                    &lt;/Panel.Body&gt;

                &lt;/Panel&gt;
            &lt;/div&gt;
        );
    }

}


function DatasetsPage(props) {
    return (
        &lt;div&gt;
            &lt;MenuContainer /&gt;
            &lt;LoginContainer /&gt;
            &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
            &lt;InvestigationContainer activeTab={1} investigationId={props.match.params.investigationId} {...props} /&gt;
        &lt;/div&gt;
    );
}

function EventsPage(props) {
    return (
        &lt;div&gt;
            &lt;MenuContainer /&gt;
            &lt;LoginContainer /&gt;
            &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
            &lt;InvestigationContainer activeTab={3} investigationId={props.match.params.investigationId} {...props} /&gt;
        &lt;/div&gt;
    );
}

function EventTagPage(props) {
    return (
        &lt;div&gt;
            &lt;MenuContainer /&gt;
            &lt;LoginContainer /&gt;
            &lt;ExpirationLoginContainer&gt;&lt;/ExpirationLoginContainer&gt;
            &lt;TagContainer investigationId={props.match.params.investigationId} context={TAG_MANAGER_CONTEXT} /&gt;
        &lt;/div&gt;
    );
}

function CameraPage(props) {
    return (
        &lt;div&gt;
            &lt;CameraContainer investigationId={props.match.params.investigationId} /&gt;
        &lt;/div&gt;
    );
}

function mapStateToProps(state) {
    return {
        user: state.user,
        selection: state.selection,
        datasets: state.datasets,
        investigations: state.investigations,
        myInvestigations: state.myInvestigations,
        releasedInvestigations: state.releasedInvestigations
    };
}



export default (connect(
    mapStateToProps
)(App));

</textarea>
  </div>
</div>

<footer class="footer">
  <div class="container">
    <p>.</p>
  </div>
</footer>

<script type="text/html" id="complexity-popover-template">
  <div class="complexity-notice">
    Complexity : {{ complexity.cyclomatic }} <br>
    Length : {{ complexity.halstead.length }} <br>
    Difficulty : {{ complexity.halstead.difficulty.toFixed(2) }} <br>
    Est # bugs : {{ complexity.halstead.bugs.toFixed(2) }}<br>
  </div>
</script>

<script type="text/javascript" src="../../assets/scripts/bundles/core-bundle.js"></script>
<script type="text/javascript" src="../../assets/scripts/bundles/codemirror.js"></script>
<script type="text/javascript" src="../../assets/scripts/codemirror.markpopovertext.js"></script>
<script type="text/javascript" src="report.js"></script>
<script type="text/javascript" src="report.history.js"></script>
<script type="text/javascript" src="../../assets/scripts/plato-file.js"></script>
</body>
</html>
