AppStateESS/InternshipInventory

View on GitHub

Showing 6,675 of 6,675 total issues

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

    render() {
        var deleteCourse = this.props.deleteCourse;
        // Determines if it needs to create a row.
        var cRow = null;
        if (this.props.subjectData != null){
Severity: Minor
Found in javascript/editCourses/courseEditor.jsx - About 1 hr to fix

Function addFiles has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    addFiles(files){
        let currentfiles = [];
        // Sends a seperate request for each file uploaded since there can be multiple at once
        $.each(files, function (key, value) {
            let formData = new FormData();
Severity: Minor
Found in javascript/affiliationAgreement/AffiliationUpload.jsx - About 1 hr to fix

Function addFiles has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    addFiles(files){
        let currentfiles = [];
        // Though there are not multiple files, data has to be sent as FormData
        $.each(files, function (key, value) {
            let formData = new FormData()
Severity: Minor
Found in javascript/contractAffiliation/ContractAffiliation.jsx - About 1 hr to fix

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

    public function execute()
    {
        $searchString = $_REQUEST['searchString'];

        // If there was no search string, return an empty array to avoid front-end errors
Severity: Minor
Found in class/Command/GetSearchSuggestions.php - About 1 hr to fix

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

    public function execute()
    {
        // Make sure an 'internship_id' key is set on the request
        if(!isset($_REQUEST['internship_id'])) {
            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'No internship ID was given.');
Severity: Minor
Found in class/Command/ShowInternship.php - About 1 hr to fix

Method createTableIndex has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function createTableIndex($column, $name = null, $unique = false)
    {
        if (!DB_ALLOW_TABLE_INDEX) {
            return false;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

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

    render() {
        var fgClasses = classNames({
            'form-group': true,
            'has-success': this.state.studentFound || this.state.hasError,
            'has-feedback': this.state.studentFound,
Severity: Minor
Found in javascript/createInterface/StudentSearch.jsx - About 1 hr to fix

Method put has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function put() {
        $postarray = json_decode(file_get_contents('php://input'));

        $Id = $postarray->id;
        $Name = $postarray->name;
Severity: Minor
Found in class/Command/SubRest.php - About 1 hr to fix

Method doTransition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function doTransition($note = null)
    {
        // Make sure the transition makes sense based on the current state of the internship
        $currStateName = $this->internship->getStateName();

Severity: Minor
Found in class/WorkflowController.php - About 1 hr to fix

Method plugValues has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function plugValues(&$student, Array $data)
    {
        /**********************
         * Basic Demographics *
         **********************/
Severity: Minor
Found in class/DataProvider/Student/LocalDbStudentDataProvider.php - About 1 hr to fix

Method buildMessage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $this->to = explode(',', $this->emailSettings->getBackgroundCheckEmail());
        $host = $this->internship->getHost();

Severity: Minor
Found in class/Email/BackgroundCheckEmail.php - About 1 hr to fix

Function onTermCreate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    onTermCreate(tcode, stype, descr, census, available, start, end, ugradOver, gradOver) {

        var errorMessage = null;

        if (tcode === '' || tcode.length !== 6) {
Severity: Minor
Found in javascript/editTerms/EditTerms.jsx - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function post()
    {
        // Check permissions
        if(!\Current_User::isLogged()){
            header('HTTP/1.1 403 Forbidden');
Severity: Minor
Found in class/Command/EmergencyContactRest.php - About 1 hr 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 addRowFunction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function addRowFunction($function)
    {
        if (is_string($function) && function_exists($function)) {
            $this->run_function = $function;
            return true;
Severity: Minor
Found in class/SubselectPager.php - About 1 hr 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 plugValues has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function plugValues(&$student, Array $data)
    {
        /**********************
         * Basic Demographics *
         **********************/
Severity: Minor
Found in class/DataProvider/Student/LocalDbStudentDataProvider.php - About 1 hr 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 _expandIndex has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _expandIndex(&$rows, $index, $item, &$stacked)
    {
        if ($this->force_array) {
            $rows[$index][] = $item;
        } elseif (isset($rows[$index]) && !$this->ignore_dups) {
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr 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 getTheQuery has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTheQuery($type){
        $sql_array = $this->getSelectSQL($type);

        if (PHPWS_Error::isError($sql_array)) {
            throw new Exception($sql_array);
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr 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 getTransitionsFromState has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTransitionsFromState(WorkflowState $state, Internship $i)
    {
        $stateName = $state->getName();

        // Strip namespace from state name by matching the last word character in the path
Severity: Minor
Found in class/WorkflowTransitionFactory.php - About 1 hr 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 addTableColumn has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function addTableColumn($column, $parameter, $after = null, $indexed = false)
    {
        $table = $this->getTable(false);
        if (!$table) {
            return PHPWS_Error::get(PHPWS_DB_ERROR_TABLE, 'core', 'PHPWS_DB::addTableColumn');
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr 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 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $faculty = $this->internship->getFaculty();
        $host = $this->internship->getHost();

Severity: Minor
Found in class/Email/EnrollmentReminderEmail.php - About 1 hr 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

Severity
Category
Status
Source
Language