AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var dData = null;
        if (this.state.dropData != null) {
            // Maps the dropdown department data and calls the DepartmentList class
            dData = this.state.dropData.map(function (dept) {
Severity: Major
Found in javascript/facultyEdit/FacultyEdit.jsx - About 2 hrs to fix

Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var states = null;

        if (this.state.dropData != null) {
            states = this.state.dropData.map(function (data) {
Severity: Major
Found in javascript/stateList/StateList.jsx - About 2 hrs to fix

Function viewShowFilter has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    viewShowFilter(data, filter) {
        var filtered = [];

        for (var i = 0; i < data.length; i++) {
            var item = data[i];
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getLinkValues has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getLinkValues()
    {
        $output = null;
        if (isset($GLOBALS['DBPager_Link_Values'])) {
            return $GLOBALS['DBPager_Link_Values'];
Severity: Minor
Found in class/SubselectPager.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function buildMessage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $this->subject = 'Internship Enrollment Issue';
        $this->to[] = $this->internship->email . $this->emailSettings->getEmailDomain();

Severity: Minor
Found in class/Email/RegistrationIssueEmail.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method execute has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute()
    {
        /* Check if user should have access to Affiliate Agreement page */
        if(!\Current_User::allow('intern', 'affiliation_agreement')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliation Agreements.');
Severity: Major
Found in class/Command/SaveAffiliate.php - About 2 hrs to fix

Function render has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var data = null
        var description = null
        if (this.state.mainData != null) {
            var onHidden = this.onHidden;
Severity: Major
Found in javascript/manager/Manager.jsx - About 2 hrs to fix

Method execute has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute() {
        // Check permissions
        if(!\Current_User::allow('intern', 'create_internship')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'You do not have permission to create new internships.');
            \NQ::close();
Severity: Major
Found in class/Command/AddInternship.php - About 2 hrs to fix

Method getLinkValues has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getLinkValues()
    {
        $output = null;
        if (isset($GLOBALS['DBPager_Link_Values'])) {
            return $GLOBALS['DBPager_Link_Values'];
Severity: Major
Found in class/SubselectPager.php - About 2 hrs to fix

Method plugStudentValues has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function plugStudentValues(&$student, \stdClass $data){
        /**********************
        * Basic Demographics *
        **********************/
        $student->setStudentId($data->bannerID);
Severity: Major
Found in class/DataProvider/Student/WebServiceDataProvider.php - About 2 hrs to fix

Function execute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        /* Check if user should have access to Affiliate Agreement page */
        if(!\Current_User::allow('intern', 'affiliation_agreement')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliation Agreements.');
Severity: Minor
Found in class/Command/SaveAffiliate.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function post has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function post($contractDir, $otherDir, $affiliationDir)
    {
        // List of known types taken from fileca$target_dir = $otherDir;binet. Only these accepted, update list of accept more.
        $known_documents = array('csv', 'doc', 'docx', 'odt', 'pdf', 'ppt', 'pptx', 'rtf',
            'tar', 'tgz', 'txt', 'xls', 'xlsx', 'xml', 'zip', 'gz', 'rar', 'ods', 'odp');
Severity: Minor
Found in class/Command/DocumentRest.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getCSV has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCSV()
    {
        // Initalize term description list, if needed
        // Store term list in a static var, so hopefully we only do this once per export
        if(!isset(self::$termDescriptionList)){
Severity: Minor
Found in class/Internship.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function addValue has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function addValue($column, $value = null)
    {
        if (is_array($column)) {
            foreach ($column as $colKey => $colVal) {
                $result = $this->addValue($colKey, $colVal);
Severity: Minor
Found in class/SubselectDatabase.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var fgClasses = classNames({'form-group': true, 'has-error': this.state.hasError});

        var availHostOptions = null;
        if (this.state.availableHost != null) {
Severity: Major
Found in javascript/createInterface/HostBlock.jsx - About 2 hrs to fix

Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var conData = null;
        if (this.props.conditionData != null) {
            conData = this.props.conditionData.map(function (condition) {
            return (
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 2 hrs to fix

Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        return (
            <div className="col-md-5 col-md-offset-1">
                <br /><br /><br />
                <div className="panel panel-default">
Severity: Minor
Found in javascript/editLevel/editLevel.jsx - About 2 hrs to fix

Method post has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function post()
    {
        $user = $_REQUEST['user'];
        $dept = $_REQUEST['dept'];

Severity: Minor
Found in class/Command/AdminRest.php - About 2 hrs to fix

Method road has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function road()
{
    $roads = array(
        'Elm',
        'Cactus',
Severity: Minor
Found in contrib/createFakeStudents.php - About 2 hrs to fix

Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        var data = null;
        if (this.state.mainData != null) {
            var onSave = this.onSave;
            data = this.state.mainData.map(function (data) {
Severity: Minor
Found in javascript/editLevel/editLevel.jsx - About 1 hr to fix
Severity
Category
Status
Source
Language