AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Function handleSubmit has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    handleSubmit(e) {
        e.preventDefault();

        var data = {systemName: this.systemNameInput.value,
                    registrarEmail: this.registrarEmailInput.value,
Severity: Minor
Found in javascript/settings/settings.jsx - About 1 hr to fix

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

  render() {
    let icon = ''
    switch (this.props.type) {
      case 'danger':
        icon = 'fa fa-exclamation-triangle'
Severity: Minor
Found in javascript/emergencyContact/Message.jsx - About 1 hr to fix

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

    render() {
        var eData = null;
        if(this.state.emgConData != null){
            eData = this.state.emgConData.map(function (conData) {
                return (
Severity: Minor
Found in javascript/emergencyContact/EmgContactList.jsx - About 1 hr to fix

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

    public function execute()
    {
        // Check permissions
        if(!\Current_User::isDeity()){
            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'You do not have permission to delete internships.');
Severity: Minor
Found in class/Command/DeleteInternship.php - About 1 hr to fix

Function updateFaculty has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function updateFaculty(faculty)
    {
      // Update the faculty details panel
      var departmentName = $("#internship_department :selected").text();

Severity: Minor
Found in javascript/formGoodies/otherGoodies.js - About 1 hr to fix

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

    public function post()
    {
        $subjectId = $_REQUEST['subjectId'];
        $cnum = $_REQUEST['cnum'];

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

Method _indexBy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _indexBy($sql, $indexby, $colMode = false)
    {
        $rows = array();

        if (!is_array($sql) || empty($sql)) {
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

Method getTableColumns has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTableColumns($fullInfo = false)
    {
        static $table_check = null;

        $table_compare = implode(':', $this->tables);
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

Method getObjects has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getObjects($class_name)
    {
        $items = null;
        $result = $this->select();

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

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

    render(){
        var b = new Date().getTime();
        var a = new Date(this.props.end_date * 1000);
        var year = a.getFullYear();
        var month = a.getMonth() + 1;
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 1 hr to fix

Function constructor has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    constructor(props) {
        super(props);

        this.state = {
            mainData: null,
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 1 hr to fix

Method get has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get() {
        $db = \phpws2\Database::newDB();
        $pdo = $db->getPDO();
        $arr = array();

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

Method exec has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function exec($ch = null)
    {

        if ($ch === null) {
            $this->rawResponse = curl_exec($this->curl);
Severity: Minor
Found in class/DataProvider/Curl.php - About 1 hr to fix

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

    public static function allowed($value)
    {
        if (!is_string($value)) {
            return false;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

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

    protected function buildMessage()
    {
        $this->tpl['NAME'] = $this->internship->getFullName();
        $this->tpl['BANNER'] = $this->internship->banner;
        $this->tpl['TERM'] = $this->term->getDescription();
Severity: Minor
Found in class/Email/CancelInternshipNotice.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 checkRequiredFields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkRequiredFields(Internship $i){
        if (!$i->isSecondaryPart()) {
            // Check the course subject
            $courseSubj = $i->getSubject();
            if (!isset($courseSubj) || $courseSubj == '' || $courseSubj->id == 0) {
Severity: Minor
Found in class/WorkflowTransition/UndergradRegistration.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 homogenize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function homogenize(&$query)
    {
        $query_list = explode(',', $query);

        $from[] = '/int\(\d+\)/iU';
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 addOrder has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function addOrder($order)
    {
        if (is_array($order)) {
            foreach ($order as $value) {
                $this->addOrder($value);
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 checkRequiredFields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkRequiredFields(Internship $i)
    {
        if (!$i->isSecondaryPart()) {
            // Check the course subject
            $courseSubj = $i->getSubject();
Severity: Minor
Found in class/WorkflowTransition/RegisterAfterIssue.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 checkRequiredFields has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkRequiredFields(Internship $i){
        if (!$i->isSecondaryPart()) {
            // Check the course subject
            $courseSubj = $i->getSubject();
            if (!isset($courseSubj) || $courseSubj == '' || $courseSubj->id == 0){
Severity: Minor
Found in class/WorkflowTransition/GraduateRegistration.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