Showing 379 of 6,675 total issues
Function doTransition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public function doTransition($note = null)
{
// Make sure the transition makes sense based on the current state of the internship
$currStateName = $this->internship->getStateName();
- 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
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(){
let list
if (this.state.currentFiles.length > 0) {
list = this.state.currentFiles.map(function(f){
let url = "index.php?module=intern&action=documentRest&type=affiliation&docId="+f.id+"&id="+this.props.affiliationId;
- Create a ticketCreate a ticket
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(){
let list
if (this.state.currentFiles.length > 0) {
list = this.state.currentFiles.map(function(f){
let url = "index.php?module=intern&action=documentRest&type=other&docId="+f.id+"&id="+this.props.internshipId;
- Create a ticketCreate a ticket
Method save
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function save(AffiliationAgreement $agreement)
{
if(!isset($agreement) || is_null($agreement)){
throw new \InvalidArgumentException('Missing agreement object');
}
- Create a ticketCreate a ticket
Method getSearchBox
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getSearchBox()
{
static $id_count = 0;
if ($id_count) {
- Create a ticketCreate a ticket
Method extractTableName
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function extractTableName($sql_value)
{
$temp = explode(' ', trim($sql_value));
if (!is_array($temp)) {
- Create a ticketCreate a ticket
Method dsn_array
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function dsn_array()
{
static $dsn_array = null;
if (!empty($dsn_array)) {
- Create a ticketCreate a ticket
Method getDownLoad
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getDownLoad($docId, $type)
{
$target_file = $this->getPath($docId, $type);
if (!file_exists($target_file)) {
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING,
- Create a ticketCreate a ticket
Function onTermSave
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onTermSave(newsemtype, newdescri, newcensusd, newavaild, newstartd, newendd, newugradover, newgradover, tcode) {
newcensusd = this.dateToTimestamp(newcensusd);
newavaild = this.dateToTimestamp(newavaild);
newstartd = this.dateToTimestamp(newstartd);
- Create a ticketCreate a ticket
Method showStudentWarnings
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function showStudentWarnings()
{
// Check if we have a student object. If we don't, then bail immediately.
if(!isset($this->student)){
return;
- Create a ticketCreate a ticket
Method post
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function post()
{
$cod = $_REQUEST['code'];
$descri = $_REQUEST['descr'];
$lev = $_REQUEST['level'];
- Create a ticketCreate a ticket
Method update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update($return_affected = false)
{
PHPWS_DB::touchDB();
$table = $this->getTable(true);
- Create a ticketCreate a ticket
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
var deleteCourse = this.props.deleteCourse;
// Determines if it needs to create a row.
var cRow = null;
if (this.props.subjectData != null){
- Create a ticketCreate a ticket
Function addFiles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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();
- Create a ticketCreate a ticket
Function addFiles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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()
- Create a ticketCreate a ticket
Function addFiles
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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();
- Create a ticketCreate a ticket
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.');
- Create a ticketCreate a ticket
Method execute
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute()
{
$searchString = $_REQUEST['searchString'];
// If there was no search string, return an empty array to avoid front-end errors
- Create a ticketCreate a ticket
Method createTableIndex
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createTableIndex($column, $name = null, $unique = false)
{
if (!DB_ALLOW_TABLE_INDEX) {
return false;
}
- Create a ticketCreate a ticket
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
var fgClasses = classNames({
'form-group': true,
'has-success': this.state.studentFound || this.state.hasError,
'has-feedback': this.state.studentFound,
- Create a ticketCreate a ticket