Showing 3,654 of 3,654 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
onKeyDown(event) {
if (event) {
switch (event.keyCode) {
case KEYCODES.ENTER:
onEventCapture(event);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 109.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function HighlightsService
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function HighlightsService(api, $q, $cacheFactory, packages: IPackagesService, privileges) {
var service: any = {};
var promise = {};
var cache = $cacheFactory('highlightList');
Function render
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const showClearFiltersButton = Object.keys(this.props.filters)
.some((key) => this.props.filters[key].length !== 0);
return (
File tasks.ts
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import moment from 'moment';
import './styles/tasks.scss';
import {gettext} from 'core/utils';
Similar blocks of code found in 2 locations. Consider refactoring. Open
link: function(scope, elem) {
scope.$watch('urgency', (urgency) => {
if (urgency) {
var spec = metadata.urgencyByValue(urgency);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 108.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
link: function(scope, elem) {
scope.$watch('priority', (priority) => {
if (priority) {
var spec = metadata.priorityByValue(priority);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 108.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const subitemTypes = Map<string, IVocabularyItem>(
vocabulary.getVocabulary(RUNDOWN_SUBITEM_TYPES).items.map((item) => [item.qcode, item]),
);
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {gettext, longFormatDateTime} = superdeskApi.localization;
const typeIcon = getIconTypeFromMimetype(
this.props.asset.mimetype ?? 'text',
);
Function ProductionTestController
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ProductionTestController($scope, contentFilters, notify, $location, $window) {
$scope.preview = null;
$scope.selected = {};
$scope.selectedItem = {};
$scope.selectedfilter = null;
Function init
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(props) {
let value;
let title;
let altTitle;
let item;
Function AuthoringTopbarDirective
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function AuthoringTopbarDirective(
TranslationService,
privileges,
authoringWorkspace: AuthoringWorkspaceService,
$q,
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const selectedDestination = this.props.value;
const destinationPersonalSpace: {id: string; label: string} = {
id: PERSONAL_SPACE, label: gettext('Personal space'),
};
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const isCreate = this.props.icon === 'icon-plus-large';
const buttonClassName = classNames(
'dropdown-toggle',
'dropdown__toggle',
Function splitterWidget
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
function splitterWidget(superdesk, $timeout, $rootScope) {
return {
link: function(scope, element) {
const MONITORING_MIN_WIDTH = 532;
const AUTHORING_MIN_WIDTH = 730;
Function SearchProviderConfigDirective
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function SearchProviderConfigDirective(searchProviderService, notify, api, modal) {
return {
templateUrl: 'scripts/apps/search-providers/views/search-provider-config.html',
link: function($scope) {
$scope.provider = null;
Function queryItems
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function queryItems(event?, data?, params?) {
var originalQuery;
if (desks.changeDesk) {
desks.changeDesk = false;
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.state.loading) {
return null;
}
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.selectedDesk != null) {
return (
<div className="sd-kanban-list sd-padding-x--2 sd-padding-t--2">
{(this.props.stages?.[this.props.selectedDesk._id] ?? []).map((stage, index) => (
Function DashboardController
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function DashboardController(
$scope,
desks,
dashboardWidgets,
api,
Function TimepickerInnerDirective
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
function TimepickerInnerDirective($compile, $document, popupService, datetimeHelper) {
var popupTpl = '<div sd-timepicker-popup ' +
'data-open="open" data-time="time" data-select="timeSelection({time: time})" data-keydown="keydown(e)">' +
'</div>';