Showing 379 of 6,675 total issues
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
var faculty = null;
if (this.props.tableData != null) {
if (this.props.tableData.length > 0) {
- Create a ticketCreate a ticket
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
var mainButton = null;
let censusDate = this.timestampToDate(this.props.census);
- Create a ticketCreate a ticket
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
// Create red asterisk for a required field
var require = <span style={{color: '#FB0000'}}> *</span>;
return (
<Modal show={this.props.show} onHide={this.handleExit} backdrop='static'>
- Create a ticketCreate a ticket
Method import
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function import($text, $report_errors = true)
{
PHPWS_DB::touchDB();
// first_import makes sure at least one query was completed
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
Open
if (tcode !== '' && stype !== '' && descr !== '' && census !== '' &&
available !== '' && start !== '' && end !== '' && ugradOver !== '' &&
gradOver !== '') {
this.refs.term_code.value = '';
this.refs.sem_type.value = '';
- Create a ticketCreate a ticket
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
// Create red asterisk for a required field
var require = <span style={{color: '#FB0000'}}> *</span>;
return (
<Modal show={this.props.show} onHide={this.handleExit} backdrop='static'>
- Create a ticketCreate a ticket
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
var fgClasses = classNames({'form-group': true, 'has-error': this.state.hasError});
var availHostOptions = null;
if (this.state.availableHost != null) {
- Create a ticketCreate a ticket
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct($supervisor_first_name, $supervisor_last_name, $supervisor_title, $supervisor_phone, $supervisor_email,
$supervisor_fax, $supervisor_address, $supervisor_city, $supervisor_state, $supervisor_zip, $supervisor_province,
$supervisor_country, $host_id){
- Create a ticketCreate a ticket
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
var fgClasses = classNames({
'form-group': true,
'has-error': this.state.hasError
});
- Create a ticketCreate a ticket
Function insert
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
public function insert($auto_index = true)
{
PHPWS_DB::touchDB();
$maxID = true;
$table = $this->getTable(false);
- Read upRead up
- Create a ticketCreate a ticket
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 post
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function post()
{
// Check permissions
if(!\Current_User::isLogged()){
header('HTTP/1.1 403 Forbidden');
- Create a ticketCreate a ticket
Method plug
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function plug()
{
$tpl = array();
$tpl['HOME_LINK'] = \PHPWS_Text::moduleLink('Menu', 'intern');
$tpl['ADD_LINK'] = \PHPWS_Text::moduleLink('Add Student', 'intern', array('action' => 'ShowInternship'));
- Create a ticketCreate a ticket
Method contractAffilationSelected
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function contractAffilationSelected($id)
{
/* Check if user should have access to folders since this method does not go through execute */
if (!\Current_User::isLogged()) {
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING,
- Create a ticketCreate a ticket
Method _getJoinOn
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function _getJoinOn($join_on_1, $join_on_2, $table1, $table2, $ignore_tables = false)
{
if (empty($join_on_1) || empty($join_on_2)) {
return null;
}
- Create a ticketCreate a ticket
Method __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct($id, $main_host_id, $sub_name, $address, $city, $state, $zip, $province, $country, $other_names, $conditions, $approve_flag){
- Create a ticketCreate a ticket
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(){
var availHost = null;
if (this.state.availableHost != null) {
availHost = this.state.availableHost.map(function (available) {
return (
- Create a ticketCreate a ticket
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let selection;
// Preselects the contract button for new internships
if(this.state.showContract && this.state.agreementType !== 'affiliation'){
selection = <ContractSelected show={this.state.showContract} internshipId={this.props.internshipId}/>
- Create a ticketCreate a ticket
Method buildMessage
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function buildMessage()
{
$faculty = $this->internship->getFaculty();
$host = $this->internship->getHost();
- Create a ticketCreate a ticket
Method saveObject
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function saveObject($object, $stripChar = false, $autodetect_id = true)
{
if (!is_object($object)) {
return PHPWS_Error::get(PHPWS_WRONG_TYPE, 'core', 'PHPWS_DB::saveObject', _('Type') . ': ' . gettype($object));
}
- Create a ticketCreate a ticket
Method insert
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function insert($auto_index = true)
{
PHPWS_DB::touchDB();
$maxID = true;
$table = $this->getTable(false);
- Create a ticketCreate a ticket